Spring Web Flow
  1. Spring Web Flow
  2. SWF-1453

Support JSR303 Validation Groups for Webflow View States

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Complete
    • Affects Version/s: 2.3.0
    • Fix Version/s: 2.4.0.M1
    • Labels:
      None

      Description

      JSR-303 allows an array of validation groups (specified as Java types) to be passed in order to validate a subset of the constraints specified on a model object. This is useful in cases where the current user only updates a certain 'group' of properties on the model object and validation must be performed before proceeding.

      SWF 2.3.0 currently does not contain an API to specify validation groups on the model object for JSR-303 validation. However, this feature would be very useful.

        Issue Links

          Activity

          Hide
          Massimo Franzoni added a comment -

          I agree with Frank Liu I can really benefit from a validation-hint at transition level ( logic could be if you specify both, the transition hint override the the view level hint ).
          Should I open a request enhancement?
          I imagine it in AbstractMvcView.getValidationHints(...) it has to execute getCurrenTransition() and read from that if there is the new attribute validationHint. I'm not an expert of spring inner logic but at first glance it does not seems complex.

          Show
          Massimo Franzoni added a comment - I agree with Frank Liu I can really benefit from a validation-hint at transition level ( logic could be if you specify both, the transition hint override the the view level hint ). Should I open a request enhancement? I imagine it in AbstractMvcView.getValidationHints(...) it has to execute getCurrenTransition() and read from that if there is the new attribute validationHint. I'm not an expert of spring inner logic but at first glance it does not seems complex.
          Hide
          Arif Mohammed added a comment - - edited

          Iam migrating my spring mvc application to use spring webflow and Iam seeing this limitation as show stopper. Is there any plan to fix this issue ?

          Here is my situation .....

          Iam using tabbed pane jsp page and on each tab I have an update button. On click of update button on particular tab, corresponding data need tobe validated.If it is a wizard kind of pages I would have navigated to different view states based on next/back buttons but since it is a single view state and has different transitions for each update button

          	<view-state id="showOperatorDetails" view="operator.view" model="operatorForm" validation-hints="'Personal,Educational,Business'">
          		<on-render>
          			<evaluate expression="operatorController.setModelAttributes(operatorForm)" />
          		</on-render>
          		<transition on="cancel" to="end" validate="false"/>
          		<transition on="updatePersonal" >	
          		  <evaluate expression="operatorController.updatePersonal(operatorForm)"/>
          		</transition>	
          		<transition on="updateEducational" >	
          		  <evaluate expression="operatorController.updateEducational(operatorForm)"/>
          		</transition>			
          		<transition on="updateBusiness" >	
          		  <evaluate expression="operatorController.updateBusiness(operatorForm)"/>
          		</transition>			
          	</view-state>
          
          Show
          Arif Mohammed added a comment - - edited Iam migrating my spring mvc application to use spring webflow and Iam seeing this limitation as show stopper. Is there any plan to fix this issue ? Here is my situation ..... Iam using tabbed pane jsp page and on each tab I have an update button. On click of update button on particular tab, corresponding data need tobe validated.If it is a wizard kind of pages I would have navigated to different view states based on next/back buttons but since it is a single view state and has different transitions for each update button <view-state id= "showOperatorDetails" view= "operator.view" model= "operatorForm" validation-hints= "'Personal,Educational,Business'" > <on-render> <evaluate expression= "operatorController.setModelAttributes(operatorForm)" /> </on-render> <transition on= "cancel" to= "end" validate= "false" /> <transition on= "updatePersonal" > <evaluate expression= "operatorController.updatePersonal(operatorForm)" /> </transition> <transition on= "updateEducational" > <evaluate expression= "operatorController.updateEducational(operatorForm)" /> </transition> <transition on= "updateBusiness" > <evaluate expression= "operatorController.updateBusiness(operatorForm)" /> </transition> </view-state>
          Hide
          Rossen Stoyanchev added a comment -

          Massimo Franzoni, frank liu, yes please open a separate ticket.

          Show
          Rossen Stoyanchev added a comment - Massimo Franzoni , frank liu , yes please open a separate ticket.
          Hide
          Massimo Franzoni added a comment -

          I implemented this feature myself, I guess I could not wait almost a year for an answer

          Show
          Massimo Franzoni added a comment - I implemented this feature myself, I guess I could not wait almost a year for an answer
          Hide
          Rossen Stoyanchev added a comment -

          Fair enough. I've created SWF-1626.

          Show
          Rossen Stoyanchev added a comment - Fair enough. I've created SWF-1626 .

            People

            • Assignee:
              Rossen Stoyanchev
              Reporter:
              Paul Wilson
            • Votes:
              8 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development