4 Replies Latest reply on Nov 8, 2008 7:02 PM by joblini

    Seam and Hibernate validation

    kirkor.grzegorz.bernas.com.pl

      I have situation when I want to check is the string passed from form have exactly 26 digits. So in my entity beam I add @Length(max = 26, min = 26).
      I use ajax validation and if I enter 1 digit validation error is shown. But when I remove him and try to save my form I get error: org.hibernate.validator.InvalidStateException with messages: invalidValues [bankAccount length must be between 26 and 26].
      My question is:
      1. why seam doesn't shows this message in ajax validation?
      2. how to made validation that accept string with 0 length, but if is more then 0 then expect exactly 26 digits?