1 Reply Latest reply on Jun 21, 2007 6:22 AM by Pete Muir

    s:validate(all) and #{entity[fieldName]}-style fields again

    C B Newbie

      Validation fails for inputText fields where the value expression is of the form: #{entity[fieldName]}

      This issue should have been fixed in Seam 1.3.0.ALPHA, but for me, this still doe not work as expected! Everything works smoothly as long as the data entered is valid. But if I enter invalid data, a hibernate validation exception is shown on a seam debug page instead of the form being rendered again with error message decorations. The effect is the same as if I had omitted the <s:validate/> (resp. <s:validateAll>) tags.

      The problem not only shows up in conjunction with #{entity[fieldName]} but also when you use a variable that has been assigned with the JSTL <c:set> tag before as shown in the snippet below.

      <c:set var="field" value="#{fooHome.instance.name}" />

      <s:decorate id="nameDecoration">

      <s:label ...</s:label>

      <span class="value #{invalid?'errors':''}">
      <h:inputText id="name" required="true"

      <s:message styleClass="error errors"/>


      the exception:
      Exception during request processing:
      Caused by javax.servlet.ServletException with message: "#{fooHome.persist}: org.hibernate.validator.InvalidStateException: validation failed for: ch.XXXXXX.ttrack.Foo"