i have 2 p:ouputpanels have rendered attribute. should rendered when value of underlying getter/setter changes. however, underlying values change in right order. first panel disappears, second panel not show up. not in html code!
my 2 panels:
<p:outputpanel id="panelparent"> <h:form> <p:outputpanel id="panelform" rendered="#{pageservice.isvisibilityform()}"> <h:commandbutton value="button" action="#{pageservice.persist}" styleclass="btn btn-primary opal_btn submit_form_new" /> </h:form> </p:outputpanel> <p:outputpanel id="panelmessage" rendered="#{pageservice.isvisibilitymessage()}"> //message </p:outputpanel> </p:outputpanel> i appreciate answer!!!
-update-
in code, reference persist method , in method change getter , setter of visibility each section.
-update1-
ok here in fact code:
<p:outputpanel id="parentpanel"> <p:outputpanel id="panelform" rendered="#{pageservice.isvisibilityform()}"> <div> <div> <h:form class="homepage_invitee_form" action="" method="post"> <p:messages id="messages" showdetail="false" autoupdate="true" closable="true" /> <h:inputtext required="true" value="#{pageservice.instance.name}" name="name" placeholder="last name" styleclass="lastname_new" id="lastname_new" type="text placeholder" /> <h:commandbutton value="press" action="#{pageservice.persist()}"/> <f:ajax render="" /> </h:commandbutton> </h:form> </div> </div> </p:outputpanel> <p:outputpanel id="panelthank" rendered="#{pageservice.isvisibilitythank()}"> <div> message </div> </p:outputpanel> </p:outputpanel> i not see fails? ;(
it's xtreme biker said <f:ajax> render attribute render elements present in dom. in case, <p:outputpanel id="panelthank"> render attribute evaluating false not in dom. therefore, <f:ajax> not render it. need point visible. change
<f:ajax render="" /> to
<f:ajax render=":panelthank" /> but more importantly change
<p:outputpanel id="panelthank" rendered="#{pageservice.isvisibilitythank()}"> <div> message </div> </p:outputpanel> to
<p:outputpanel id="panelthank"> <p:outputpanel rendered="#{pageservice.isvisibilitythank()}"> <div> message </div> </p:outputpanel> </p:outputpanel> consider refactoring code also. instance, action , method in <h:form> not needed.
Comments
Post a Comment