JSF validation Message Display in Dialog Box when Button click -
i need jsf validation messages displaying in dialog box when button clicked dialog box should shown not hidden.
<h:form prependid="false"> <h:panelgrid columns="1" cellpadding="5"> <p:commandbutton value="modal" onclick="dlg2.show();" type="button" /> </h:panelgrid> <p:dialog header="modal dialog" widgetvar="dlg2" modal="true" height="200" width="400"> <h:panelgrid columns="1" > <p:messages /> <p:inputtext id="txt" value="#{converterbean.doublevalue}" required="true"/> <p:commandbutton ajax="false" value="submit" action="#{converterbean.submit}" /> </h:panelgrid> </p:dialog> </h:form>
your case similar this example primefaces showcase.
notice <h:form>
inside <p:dialog>
there. notice in example's loginbean.java how callback parameter set.
change <p:commandbutton>
updates <p:messages>
(it updates <p:growl>
in example.
Comments
Post a Comment