I'm using Glassfish 3.0.1, CoDI 0.9.1, extVal 2.0.4 and PrimeFaces 2.2RC2. I'm using the Callbackparameters of the RequestContext API to determine if validation in the backing bean failed. Normally, what I've seen in the showCase, the "validationFailed" flag is set automatically on beanvalidation.
Here is part of my backing bean, the @Equals anntoation is from myFaces extVal:
Code: Select all
@Named
@RequestScoped
public class KontoeinstellungenBean extends AbstractProfilBean {
private static final long serialVersionUID = 4849123094557530545L;
@Size(min = 8, max = 20)
@Equals(value = "kennwort2", parameters = ViolationSeverity.Error.class)
private String kennwort;
@Size(min = 8, max = 20)
private String kennwort2;
Code: Select all
<p:dialog header="#{msgs.kennwort_titel}" widgetVar="dlgChangepassword" modal="true" >
<h:form id="changePasswordForm">
<h:panelGrid id="changePassword" columns="2" style="border:2px" rowClasses="row-0, row-1">
<h:outputLabel for="kennwort" value="#{msgs.kennwort_neuesKennwort}" />
<h:inputSecret id="kennwort" value="#{kontoeinstellungenBean.kennwort}" />
<h:outputLabel for="kennwort2" value="#{msgs.kennwort_neuesKennwort2}" />
<h:inputSecret id="kennwort2" value="#{kontoeinstellungenBean.kennwort2}" />
<f:facet name="footer">
<p:commandButton value="#{msgs.portal_button_change}" update="growl @form" actionListener="#{kontoeinstellungenBean.changePassword}" oncomplete="handleComplete(xhr, status, args)"/>
</f:facet>
</h:panelGrid>
<p:messages showDetail="true" showSummary="false" />
</h:form>
</p:dialog>
<script type="text/javascript">
function handleComplete(xhr, status, args) {
if(!args.validationFailed) {
dlgChangepassword.hide();
}
}
</script>
When I type different passwords longer than 8 digits the "valdationFailed" flag isn't set and as a result I close the dialog.
Did I miss soemthing here or Is this a problem in the RequestContext API or does extVal simply not set the right field, flag .....?