myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gerhard <gerhard.petra...@gmail.com>
Subject Re: extVal + PrimeFaces 2.2 RC2
Date Mon, 13 Dec 2010 18:09:29 GMT
hi thomas,

please have a look if ViolationExceptionInterceptor gets called after the
violation.

regards,
gerhard

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces



2010/12/13 Ing. Thomas Kernstock <t.kernstock@e-technologies.at>

> Hi all,
>
> 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 Primefaces RequestContext API to
> determine if validation in the backing bean failed. Normally the
> "validationFailed" flag is set automatically on beanvalidation.
> Here is part of my backing bean:
>
> @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;
>
>
> The view is a simple dialog with 2 password fields ->
>
> <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 in a password that is smaller than 8 digits plus the two
> passwords are different, the "valdationFailed" flag is set and as a result
> I
> don't close the dialog -> both errormessages are displayed in the
> <h:messages > field.
> When I type different passwords longer than 8 digits the "valdationFailed"
> flag isn't set and as a result I close the dialog.
>
> So my question is if extVal uses a different mechanisms to indicate
> validationerrors than the standard valdation ? Do I miss a parameter or
> something else to make this work ?
>
>
> best regards
>
> Thomas
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message