page refresh - Primefaces tab not updating properly -


i have dialogue commandbutton, , i'm trying do:

  1. do java work
  2. update primefaces tab
  3. make dialogue box disappear
  4. go tab.

this code i'm using:

                <p:commandbutton value="submit"                 action="<some java work>"                 oncomplete="dialogue.hide(); sidetabs.select(1)"                 update="<update side tab">             </p:commandbutton> 

the problem is, works once between refreshes. mean is, click button, , works fine-the tab changes requested tab, tab updated, , dialogue disappears. when click button again, requested tab indeed selected, isn't refreshed until hit f5. once that, can click dialogue button again , tab refresh again, once again, once - until hit f5 again. so, this:

  1. click button -> see 1 item in tab
  2. click button again -> still see 1 item in tab
  3. hit f5 -> see 2 items in tab
  4. click button -> see 3 items in tab
  5. click button again -> still see 3 items in tab
  6. hit f5 -> see 4 items in tab etc...

does have idea why happening? need add page refresh mechanism commandbutton? if so, how done? thanks!!!

i've tried replicate problem no success.

here attribute viewscoped bean:

private string str1 = "a";  private string str2 = "b";  private string update = ":f:t";  private integer index = 0; 

and here view:

<h:form id="f">     <p:tabview id="t" widgetvar="tvar" activeindex="#{viewmbean.index}" >         <p:tab id="a" title="a" >             #{viewmbean.str1}         </p:tab>         <p:tab id="b" title="b">             #{viewmbean.str2}         </p:tab>     </p:tabview> </h:form>  <p:dialog id="d" widgetvar="dvar">     <h:form>         <p:inputtext value="#{viewmbean.str1}" />         <br />         <p:inputtext value="#{viewmbean.str2}" />         <br />         <p:inputtext value="#{viewmbean.update}" />         <br />         <p:inputtext value="#{viewmbean.index}" />         <br />         <p:commandbutton value="submit" update="#{viewmbean.update}" oncomplete="dvar.hide();" />     </h:form> </p:dialog> 

i believe problem somewhere else in code.


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -