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

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

    cba2

      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.

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

      <s:decorate id="nameDecoration">

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

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


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

      </s:decorate>
      {code}

      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"

        • 1. Re: s:validate(all) and #{entity[fieldName]}-style fields ag
          pmuir

          The problem here is that Seam doesn't support using "parameterized" value bindings like that one - the EL expression on the page must be resolvable without any variables that are declared on the page. We should be able to fix this with jboss-el, but not in the 1.3.0.GA timescale I expect.