page refresh - Primefaces tab not updating properly -
i have dialogue commandbutton, , i'm trying do:
- do java work
- update primefaces tab
- make dialogue box disappear
- 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:
- click button -> see 1 item in tab
- click button again -> still see 1 item in tab
- hit f5 -> see 2 items in tab
- click button -> see 3 items in tab
- click button again -> still see 3 items in tab
- 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
Post a Comment