I have the following confirm dialog
<p:confirmDialog global="true" showEffect="fade" hideEffect="fade" header="Modal Dialog" modal="true" width="430" height="120" >
<p:commandButton value="Ok" type="button" styleClass="ui-confirmdialog-yes myButton" icon="ui-icon-check" style="float:right;font-family:verdana, Arial; font-size:10pt; color:#ffffff; font-weight:bold;text-align:center;"/>
<p:commandButton value="Cancel" type="button" styleClass="ui-confirmdialog-no myButton" icon="ui-icon-close" style="float:right;font-family:verdana, Arial; font-size:10pt; color:#ffffff; font-weight:bold;text-align:center;"/>
</p:confirmDialog>
and call the confirm like the following,
<p:commandLink style="text-decoration: none;" global="false" action="#{resetPasswordWindowController.changePassword()}" update="@form" >
<p:panelGrid id="loginButtonGrid" layout="tabular" styleClass="loginButtonGrid" >
<p:row styleClass="loginButtonGridRow">
<p:column styleClass="loginButtonGridText lighterGreenBackground roundLeftCorners" >
Reset
</p:column>
</p:row>
</p:panelGrid>
<p:confirm header="Reset Password" message="Are you sure?" icon="ui-icon-alert" />
</p:commandLink>
It works fine as i expected but the confirm dialog is called before even server side validation happens.
in my case i am trying to validate password and confirm password change and just giving the alert to confirm that the user really wants to change it.
Expected Results would be :
1. Validate the password and confirm password and if they are valid only show the confirm dialog and proceed to save based on the confirmation we get from confirm dialog.
Thanks