3 Replies Latest reply on Oct 31, 2007 9:16 AM by pmuir

    Seam + Hibernate-Validator validation problem

    axismundi

      Following the Seam-manual we are experiencing trouble to get validation running with Seam 2.0.CR2/Icefaces 1.6.1

      JSF:

      <ice:outputLabel for="firstName" value="Vorname" />
      <ice:inputText id="firstName" value="#{checkoutCart.bean.firstName}" required="true"/>
      <br/><h:message for="firstName" />
      


      Bean-class:
      @NotNull
      @Pattern(regex="^[a-zA-Z.-]+", message="Fehlender oder ungültiger Nachname")
      @Override
      public String getFirstName() {
       return firstName;
      }


      With this code, leaving the field _blank_ results in "value is required"-message, coming from the JSF-implementation. The custom message "Fehlender..." is ignored.
      If an _invalid_ value is entered, the correct error-message appears

      Replacing
      <h:message for="firstName" />

      with
      <s:message for="firstName" />
      doesnt change anything.

      Obviously, using required="true" prevents Seam from handling the validation. Any solution for this available, or better to use standard-JSF validation?