Validation message not rendered in dialog using jsf

primefaces, validation

Solution

In your submit button add these entries

ajax="true" update=":#{p:component('message')}" oncomplete="if(!args.validationFailed)dlgEdit.hide();"

This will print your message in the same dialog.

Problem

``` <p:dialog widgetVar="dlgEdit" header="Add New Status"> <h:form id="editFrm"> <h:panelGrid columns="3" id="pnlEdit"> <p:outputLabel value="Status"/> <p:inputText id="txtStatus" required="true"/> <p:message for="txtStatus" /> </h:panelGrid> </p:dialog> ``` This is a primefaces message tag which is not rendered in dialog. And dialog is hide on onComplete event.. ``` How can I RENDER validation message in DIALOG using jsf? ``` Thank for any suggestion !

Original source