0

Spring Web Flow... how to stop Form Validation on only one transition.

How to stop Form Validation on only one transition. With the following code I have form validation turn on and everything is working great but if the user clicks "cancel" I dont want to run the form validation. anyway around this?

<view-state id="helloworld" view="input.jsp" model="customer" popup="true">
<transition on="submit" to="preview" />
<transition on="cancel" to="thanks"/>
</view-state> 
Johnathan Smith
  • 1,112
  • 2
  • 17
  • 34

1 Answers1

6

Transitions have the ability to define whether or not you want binding and validation, just set them to false.

<view-state id="helloworld" view="input.jsp" model="customer" popup="true">
<transition on="submit" to="preview" />
<transition on="cancel" to="thanks" validate="false" bind="false"/>
</view-state>
John Vint
  • 39,695
  • 7
  • 78
  • 108