I am doing CRUD functionality using dialogs and I have added the p:messages on top to display messages
If validation fails for example the required property when user clicks save, it is being shown at the p:messages.
Code: Select all
<p:dialog id="addMemberDialog" header="Member Details"
widgetVar="addMemberDlg" resizable="false" closable="false"
modal="true">
<p:messages id="createupdateformmessages" />
<h:form id="createupdateform">
<p:panelGrid columns="2" id="panel">
<f:facet name="header">
Create Member
</f:facet>
<h:outputLabel value="First Name:" for="firstName" />
<p:inputText label="First Name" id="firstName" title="First Name"
required="true" value="#{memberManagedBean.newMember.firstName}">
</p:inputText>
<!-- More Code here -->
<f:facet name="footer">
<p:commandButton value="Save"
update=":memberListForm:membersTable createupdateform :createupdateformmessages"
process="@form" />
<p:commandButton value="Cancel" immediate="true" process="@this"
oncomplete="addMemberDlg.hide()" />
</f:facet>
</p:panelGrid>
</h:form>
</p:dialog>
Suppose I have First Name/Middle Name/Last Name as failed in validation of 'required' and so when I start typing at the first name field then the p:messages should disappear.
What happens right now is that the p:messages is shown even if I start filling the input text with data which is the default functionality?
Primefaces 3.2