jsf - PrimeFaces Dialog + appendToBody=true not working -


i'm using pf 3.5 , jsf mojarra 2.1.

i have dialog want use appendtobody=true. results in "unpredictable behavior" though.

basically dialog is, when choose entry (a persn entity) datatable, gives me filled input boxes can edit, editing particular entry (person details).

sometimes input boxes filled entries data. dont. behavior not happen appendtobody=false. aside i'm pretty sure there no nested forms.

as notice trying out "one page design" purely ajax navigation.

main page (index.xhtml)

<h:body>      <pe:layout id="page" fullpage="true">          <!-- north -->         <pe:layoutpane id="north" position="north" minsize="140"             closable="true" resizable="false">             ....         </pe:layoutpane>          <!-- west -->         <pe:layoutpane id="west" position="west" minwidth="150" size="180"             style="font-size: 14px !important;" closable="true"             styleclassheader="menubar" resizable="false">             <f:facet name="header">main menu</f:facet>              <h:form id="form1">                  <p:panelmenu id="panelmenu" style="width: 160px !important">                      <!-- on menu click update ajax centerpanel , msgpanel -->                     <p:submenu label="persons" style="font-size: 10px ">                          <p:menuitem value="person list" update=":centerpanel"                             actionlistener="#{layout.setall('formpersonlist.xhtml', 'person list')}"                             action="#{person.init()}">                         </p:menuitem>                      </p:submenu>                      .....                  </p:panelmenu>             </h:form>         </pe:layoutpane>          <!-- center -->         <pe:layoutpane id="content" position="center"             style="font-size: 14px !important" styleclassheader="menubar">              <h:panelgroup id="centerpanel" layout="block">                 <ui:include id="include" src="#{layout.navigation}" />              </h:panelgroup>          </pe:layoutpane>     </pe:layout> 

the dialog in file formpersonlist.xhtml , outside form

<ui:composition ....>         <h:form id="mainform">             <p:contextmenu for="persontable">                  <p:menuitem value="view details"                              process="@form" actionlistener="#{person.handleselectedperson()}"                             update=":dlgpersongrp"                             oncomplete="dlgperson.show();">                 </p:menuitem>              </p:contextmenu>          <p:datatable id="persontable ....>             ....person entities         </p:datatable>        </h:form>      <p:dialog   widgetvar="dlgperson" showeffect="size"                 width="1100"  appendtobody="true">                  <h:panelgroup id="dlgpersongrp">                     <ui:include src="formperson.xhtml" />                 </h:panelgroup>       </p:dialog> </ui:composition> 

finally, form input boxes: formperson.xhtml

<ui:composition ....>         <h:form id ="subform">                 ....input boxes supposed filled backing bean                      , resubmitted edit chosen entry         </h:form>  </ui:composition> 

i have tried dumb down as possible. let me know if need more detail.

i know old question, having same problem primefaces 5. solution simple, i've included attribute appendto="@(body)" in tag.

<p:dialog header="title" widgetvar="dlg" modal="true" appendto="@(body)">   <h:outputtext value="dialog text..." />   <p:commandbutton value="ok" onclick="pf('dlg').close()" /> </p:dialog> 

Comments

Popular posts from this blog

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

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

javascript - storing input from prompt in array and displaying the array -