Uploaded image for project: 'Spring Web Flow'
  1. Spring Web Flow
  2. SWF-1469

view state transition using EL expression and the validation attribute is ignored

    XMLWordPrintable

    Details

      Description

      <view-state id="test" view="test" model="testForm">
      <transition on="#

      {T(my.super.package.TestFormEvent).FETCH_STUFF.getValue()}

      " validate="false">
      <evaluate expression="...." />
      <render fragments="...." />
      </transition>

      <transition on="#

      {T(my.super.package.TestFormEvent).SAVE.getValue()}

      " to="...">
      <evaluate expression="...." />
      </transition>
      </view-state>

      If I'm using an EL expression for the transition 'on' attribute; the 'validate' attribute is ignored and the model is validated!

      I've got a Java Enum for my different transition events to be able to handle nicely different validation based on a specific transition.

      public void validate(ValidationContext validationContext) {

      switch (TestFormEvent.find(validationContext.getUserEvent()))

      { case SAVE: // do some validations on top of the JSR 303 break; case UPDATE_STUFF: // do some different validation break; }

      }

      The different type of validations is to manage my child AJAX forms.

      The work around for this issue; is to clear the message context on my FETCH_STUFF event. It'll be far better if SWF handles correctly the transition parsing so the validation is not processed.

        Attachments

          Activity

            People

            Assignee:
            kdonald Keith Donald
            Reporter:
            cedricb cedric bompart
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: