Suppose having a p:dialog
with an <o:validateOne>
on submit button where p:dialog
will close after that the dialog closes even if the validation is still required
<h:form>
<h:outputText id="newValueId" value="#{myBean.newValue}/>
<p:dialog id="dialog" widgetVar="dlg" resizable="false" dynamic="true"
appendToBody="false" modal="true">
<o:validateOne id="one" components="name1 name2"
message="one is required"/>
<h:panelGrid columns="2" cellpadding="5">
<h:outputLabel value="name 1 :" />
<p:inputText value="#{myBean.name1}" id="name1"/>
<h:outputLabel fvalue="name 2 :" />
<p:inputText value="#{myBean.name2}" id="name2"/>
<p:commandLink id="okId" value="ok" update="growl newValueId"
action="#{myBean.updateMyForm}"
process="dialog"
oncomplete="if(!args.validationFailed())dlg.hide();"/>
</h:panelGrid>
</p:dialog>
class Mybean{
String name1,name2,newValue;
public void updateMyForm(){
newValue=name1 + " " + name2;
}
//getter and setters
}
I want the dialog to not close if the two inputs input1 and input2 are still empty
But what what's happening is that dialog is closed and message is the displayed in the growl