Ich habe die Bestätigung wie die folgende folgende confirm dialog
rufen Sie die p: confirmDialog nur auf eine erfolgreiche Validierung in JSF
<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>
und rufen,
<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>
Es funktioniert gut, wie ich erwartet hatte, aber die Bestätigungs Der Dialog wird aufgerufen, bevor die serverseitige Validierung stattfindet.
In meinem Fall versuche ich, das Passwort zu validieren und die Passwortänderung zu bestätigen, und gebe nur die Benachrichtigung, um zu bestätigen, dass der Benutzer es wirklich ändern möchte.
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