I have a form with 2 required input fields and a command button which shows a dialog:
<p:commandButton id="showDialogButton" value="Enregistrer"
action="#{DEQbean.Ajouter()}" update="@form"
oncomplete="dialogaboutDEQ.show()" />
<p:dialog id="reamrquesDEQ" widgetVar="dialogaboutDEQ" header="Informations"
width="400" closable="false" resizable="false" showEffect="clip"
hideEffect="clip" modal="true" appendToBody="true">
<p:messages id="messages" showDetail="true" autoUpdate="true"/>
<p:commandButton value="OK" action="DEQlist" />
</p:dialog>
I would like to show the dialog only when the validation has passed and the action method is executed. However, when the required input fields are empty and the action method is thus not executed, the dialog is still shown.
How do I display the dialog only on complete of a successful form submit?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…