I have two dialog in form
<h:form id="main">
<p:messages id="msgs" />
<p:dialog header="Dialog 1" >
<p:panelGrid columns="2" id="PG1" >
<p:outputLabel value="Name" for="name" />
<p:inputText required="true" id="name" value="#{myBean.name}" />
<p:outputLabel value="Age" for="age"/>
<p:inputText required="true" id="age" value="#{myBean.age}" />
</p:panelGrid>
<p:commandButton value="Add1" ajax="false" validateClient="true" actionListener="#{myBean.Add1}"/>
<p:commandButton ajax="true" value="Open PG2" onclick="PG2.show()" immediate="true" />
</p:dialog>
<p:dialog header="Dialog 2" >
<p:panelGrid columns="2" id="PG2" >
<p:outputLabel value="House" for="house" />
<p:inputText required="true" id="house" value="#{myBean.house}" />
<p:outputLabel value="Street" for="street"/>
<p:inputText required="true" id="street" value="#{myBean.street}" />
</p:panelGrid>
<p:commandButton value="Add2" ajax="false" validateClient="true" actionListener="#{myBean.Add2}"/>
</p:dialog>
</h:form>
When I open the second dialog , and Press "Add2" button. it validate the "Dialog 1" elements. I want to validate the "Dialog 2" elements only when Press "Add2" button, not all elements in the form.
Any update!!