jsf 2 - Primefaces v.5.3.5 confirm dialog render issue outside main h:form and inside main form is rendered but it is not working properly -
i using pf v.5.3.5 , jsf v.2.2.8. frequent topic in so. noticed there bug in pf v.5.3.5 documentation related appendto attribute.
1st approach
the p:confirmdialog rendered , commandbuttons rendered actions not work , message not rendered if placed inside of nested h:form.
2st approach
if place dialog outside of main h:form not rendered @ if add global="true" attribute.
3st approach
the p:confirmdialog rendered , commandbuttons rendered actions not work , message rendered if nested h:form removed.
<h:form> ... <p:confirmdialog id="asksessiondialog1" widgetvar="asksessiondialog1" severity="alert" appendto="@(body)" rendered="#{treedata.asksessiondialogrendered}" visible="#{treedata.asksessiondialogrendered}"> <h:form> <f:facet name="message"> <h:outputtext value="#{msg.web_admin_pages_treesegment_nosession}" escape="false"/> </f:facet> <p:commandbutton value="#{msg.web_buttons_ok}" action="#{treedata.save(false, true)}" icon="fa fa-check" update="@(form)" type="button" /> <p:commandbutton value="#{msg.web_buttons_cancel}" action="#{treedata.setasksessiondialogrendered(false)}" icon="fa fa-close" onclick="pf('asksessiondialog1.hide()')" update="@(form)" type="reset" /> </h:form> </p:confirmdialog> ... </h:form>
beckend part
setasksessiondialogrendered(true); requestcontext.getcurrentinstance().update("treesegmentform asksessiondialog askturnoffdialog asksessiondialog1 askturnoffdialog1");
thanks in advance constructive posts , comments.
solved best approach works me now.
<h:form> ... <p:confirmdialog id="asksessiondialog" widgetvar="asksessiondialog" severity="alert" appendto="@(body)" rendered="#{treedata.asksessiondialogrendered}" visible="#{treedata.asksessiondialogrendered}"> <f:facet name="message"> <h:outputtext value="#{msg.web_admin_pages_treesegment_nosession}" escape="false"/> </f:facet> <h:form> <p:commandbutton value="#{msg.web_buttons_ok}" icon="fa fa-check" type="button" accesskey="o"> <p:ajax event="click" listener="#{treedata.save(false, true)}" oncomplete="pf('asksessiondialog').hide()" update="@(form)" /> </p:commandbutton> <p:commandbutton value="#{msg.web_buttons_cancel}" icon="fa fa-close" type="reset" accesskey="c"> <p:ajax event="click" listener="#{treedata.setasksessiondialogrendered(false)}" onsuccess="pf('asksessiondialog').hide()" update="@(form)" /> </p:commandbutton> </h:form> </p:confirmdialog> ... </h:form>
backend
setasksessiondialogrendered(true); requestcontext.getcurrentinstance().update("treesegmentform");
spacial to: @yagamilight helped me kick off solution.
Comments
Post a Comment