Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think I resolved this problem. I used <code>p:remoteCommand</code> after I saw <a href="https://stackoverflow.com/questions/16173811/cannot-show-dialog-in-primefaces-requestcontext-execute-call">this thread</a>.</p> <p>And here's my final codes:</p> <p>Page:</p> <pre><code> &lt;p:tabView effect="fade" effectDuration="normal"&gt; &lt;p:ajax event="tabChange" listener="#{myConsoleBean.onTabChange}" oncomplete="dlg.hide()" update=":rightForm"/&gt; &lt;p:tab title="My"&gt; &lt;/p:tab&gt; &lt;p:tab id="statTab" title="Stat"&gt; &lt;p:remoteCommand actionListener="#{myConsoleBean.goToUrl('myStat.xhtml')}" update=":rightForm" name="showStat" global="true" onstart="dlg.show()" oncomplete="dlg.hide()"&gt;&lt;/p:remoteCommand&gt; &lt;/p:tab&gt; &lt;/p:tabView&gt; &lt;p:dialog id="pBarDialog" header="Progressing..." widgetVar="dlg" modal="true" height="70" resizable="false" closable="false"&gt; &lt;h:outputText value="Please wait, we are generating your info..." /&gt; &lt;p:progressBar widgetVar="pbAjax" ajax="true" value="100" styleClass="animated"&gt; &lt;/p:progressBar&gt; &lt;/p:dialog&gt; </code></pre> <p>Bean:</p> <pre><code> public void onTabChange(TabChangeEvent event) { TabView tv = (TabView) event.getComponent(); int activeTabIndex = tv.getActiveIndex(); if(activeTabIndex==1) { RequestContext.getCurrentInstance().execute("showStat()"); } } </code></pre> <p>No matter how, thank you both,Lamq and Emil Kaminski. I will never find that thread without your help because I type key words from your answers.</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.
    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