jsf - PrimeFaces 5.1 nested form inside p:dialog with appendTo="@(body) -
jsf - PrimeFaces 5.1 nested form inside p:dialog with appendTo="@(body) -
i have fragment:
<h:form id="form"> <!-- other content --> <p:panel id="panel" header="test"> <p:inputtext id="input1" value="#{viewscope.prop1}" required="true" /> <p:commandbutton id="button1" process="@form" update="@form @widgetvar(dialog)" oncomplete="pf('dialog').show()" value="ok" /> </p:panel> <!-- other content --> </h:form> <p:dialog id="dialog" header="dialog" widgetvar="dialog" modal="true"> <h:form id="form2"> <p:inputtext id="input2" value="#{viewscope.prop1}" required="true" /> <p:commandbutton id="button2" process="@form" update="@form" value="ok" /> </h:form> </p:dialog>
and working expected.
what i'd accomplish this:
<h:form id="form"> <!-- other content --> <!-- fragment start --> <!-- fragment on own file , included via ui:include (or within composite component) --> <p:panel id="panel" header="test"> <p:inputtext id="input1" value="#{viewscope.prop1}" required="true" /> <p:commandbutton id="button1" process="@form" update="@form @widgetvar(dialog)" oncomplete="pf('dialog').show()" value="ok" /> </p:panel> <p:dialog id="dialog" header="dialog" widgetvar="dialog" modal="true" appendto="@(body)"> <h:form id="form2"> <p:inputtext id="input2" value="#{viewscope.prop1}" required="true" /> <p:commandbutton id="button2" process="@form" update="@form" value="ok" /> </h:form> </p:dialog> <!-- fragment end --> <!-- other content --> </h:form>
but unsuccessfully tried combination of process
, update
button1
resulting in process anything... input1
resetting...
so, how build p:dialog
can shipped within fragment or composite comp , excluded outside form
?
note using:
<h:form id="form"> <!-- other content --> <ui:include src="panel.xhtml" /> <!-- other content --> </h:form> <ui:include src="dialog.xhtml" />
is not acceptable solution.
i'm on jsf 2.2.8 (mojarra) , pf 5.1
only utilize 1 form within of dialog. work fine me.
<h:body> <h:form id="oneformid"> <!-- content --> </h:form> <p:dialog id="mydialogid" header="my header info" widgetvar="mywidgetvarname" modal="true" appendto="@(body)"> <h:form id="myformid"> <p:outputpanel> <p:messages id="mymsgid" autoupdate="true" /> <h:panelgrid columns="2"> <h:outputlabel for="usr" value="user:" /> <p:inputtext id="usr" value="#{mymanagebeanname.myproperty}" required="true" requiredmessage="user required." /> </h:panelgrid> <p:separator /> <h:panelgrid columns="2"> <p:commandbutton value="save" id="mybtnsaveid" styleclass="ui-priority-primary" icon="ui-icon-circle-check" process="@form" /> <p:commandbutton value="cancel" id="mybtncancelid" onclick="pf('mywidgetvarname').hide()" styleclass="ui-priority-primary" icon="ui-icon-close" process="mybtncancelid" /> </h:panelgrid> </p:outputpanel> </h:form> </p:dialog> <h:form id="otherformid"> <!-- content --> </h:form>
jsf primefaces dialog nested-forms jsf-2.2
Comments
Post a Comment