Primefaces 3.5 dialog's 'visible' attribute does update correctly after ajax 'close' event -


solution here. (showing , hiding dialog within bean.)


i have dialog , show/hide buttons works fine. dialog reads boolean value backing bean , updates it's visible attribute (which makes show or hide). works fine until close dialog using default close button, fires ajax close event. moment on show/hide buttons not work, or rather dialog not update it's visible state. stays closed forever.

i found out that, after ajax event fired, updates correctly except dialog visible attribute. buttons works fine, updates backing bean correctly (i can see in log file), , dialog panel updated correctly (i can see correct showdialog value displayed on screen).

i know there other ways show/hide dialogs, yet curious happening in case - why works way? there way display dialog reading visibility value bean (and what's more important update bean value when dialog closing)?

my xhtml:

<h:form>     <p:commandbutton value="show d1" actionlistener="#{testbean.enableshowdialog()}" update=":dialogid"/>     <p:commandbutton value="hide d1" actionlistener="#{testbean.disableshowdialog()}" update=":dialogid"/> </h:form> <p:outputpanel id="dialogid">     showdialog value = #{testbean.showdialog}     <p:dialog header="d1" visible="#{testbean.showdialog}">         <p:ajax event="close" listener="#{testbean.disableshowdialog()}" update=":dialogid"/>         test     </p:dialog> </p:outputpanel> 

and backing bean:

@managedbean @viewscoped public class testbean implements serializable {     private static final logger logger = loggerfactory.getlogger("tb");      private boolean showdialog;      public boolean isshowdialog() {         logger.info("getter isshowdialog={}", showdialog);         return showdialog;     }      public void enableshowdialog() {         showdialog = true;         logger.info("isshowdialog set true");     }      public void disableshowdialog() {         showdialog = false;         logger.info("isshowdialog set false");     } } 

maybe can hide close button:

closable="true" 

or maybe can update variable through onhide attribute.

i noticed dialog not in form?

found similar post here

and here think hint you, gave me answer: add oncomple="somedialog.show()" event buttons , widgetvar="somedialog" dialog understand close changes rendered attribute, thats why can't show it.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -