jsf - Validation password doesn't work in p:dialog -
i'm using primefaces 4.0 , i'm trying use dialog change password. used password component job n't work in dialog works fine when i'm not using dialog.
here code
<h:form> <p:dialog widgetvar="changepw" resizable="true" appendto="@(body)" modal="true" closable="false" id="changepw"> <p:panel header="change password"> <p:messages id="messages" showdetail="true" showsummary="false" autoupdate="true" /> <h:panelgrid columns="2" id="matchgrid"> <h:outputlabel for="pwdnew" value="new: *" /> <p:password id="pwdnew" value="#{passwordbean.newpw}" feedback="true" match="pwdconf" required="true" validatormessage="pw n't matches" requiredmessage="value required"> </p:password> <p:messages showdetail="true" showsummary="false" autoupdate="true" for="pwdnew" /> <h:outputlabel for="pwdconf" value="confirm password: *" /> <p:password id="pwdconf" value="#{passwordbean.newpwconfirmation}" feedback="true" required="true" validatormessage="invalid password" requiredmessage="value required"> <f:validateregex pattern="[a-za-z0-9]{8,60}" /> </p:password> </h:panelgrid> </p:panel> <p:separator></p:separator> <p:commandbutton value="save" update="matchgrid" process="@this" ajax="true" actionlistener="#{passwordbean.changepw}" styleclass="ui-confirmdialog-yes" oncomplete="changepw.hide();" icon="ui-icon-check" /> <p:commandbutton value="cancel" process="@this" onclick="changepw.hide();" styleclass="ui-confirmdialog-no" icon="ui-icon-close" /> </p:dialog> ...
thank suggestion !
if use 'appendto="@(body)"', need form in dialog can read in primefaces documentation. make sure in original xhtml not nested!
in addition, process="@this"
on buttons prevent other inputs submitted (this won't work outside dialog, did not have there). remove well
Comments
Post a Comment