Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot show dialog in Primefaces RequestContext.execute() call
    primarykey
    data
    text
    <p>I have a tabview in which I want to refresh contents of one specific tab whenever user selects that tab. I also want modal dialog to pop up while tab is being refreshed.</p> <p>Here is tabView with tabChange ajax event handler</p> <pre><code>&lt;p:dialog widgetVar="statusDialog" modal="true" draggable="false" minimizable="false" appendToBody="true" closable="false" header="Processing..." resizable="false" maximizable="false"&gt; &lt;p:graphicImage library="assets" name="ajax-loader.gif"&gt;&lt;/p:graphicImage&gt; &lt;/p:dialog&gt; &lt;p:tabView id="tabview" orientation="top" dynamic="false"&gt; &lt;p:ajax event="tabChange" listener="#{bean.tabChangeListener}"&gt;&lt;/p:ajax&gt; &lt;p:tab title="tab1"&gt; &lt;ui:include src="/WEB-INF/views/tab1.xhtml"/&gt; &lt;/p:tab&gt; &lt;p:tab title="tab2"&gt; &lt;p:remoteCommand actionListener="#{bean.refreshData}" update="someTab2ElementID" name="refresh" global="true" onstart="statusDialog.show()" oncomplete="statusDialog.hide()"/&gt; &lt;ui:include src="/WEB-INF/views/tab2.xhtml"/&gt; &lt;/p:tab&gt; &lt;/p:tabView&gt; </code></pre> <p>Here is tabChangeListener:</p> <pre><code>public void tabChangeListener(TabChangeEvent event) { if ( event.getTab().getId().equalsIgnoreCase("tab2") ) { RequestContext.getCurrentInstance().execute("refresh()"); } } </code></pre> <p>The refresh remoteCommand is being called as expected, but my statusDialog is never shown. If the same remoteCommand is triggered by a button click the statusDialog appears. There are no errors in JavaScript console.</p> <p>Why is statusDialog not shown when remoteCommand is triggered by RequestContext.execute() and how can I make it appear? I even tried adding statusDialog.show() to execute() but it didnt help.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload