0
我有以下confirm dialog
撥打號碼:confirmDialog只在成功驗證在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>
,並致電確認類似下面,
<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>
它正常工作,如我所料,但確認在服務器端驗證發生之前調用對話框。
在我的情況下,我正在嘗試驗證密碼並確認密碼更改,並給出提醒以確認用戶真的想要更改它。
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