Results 1 to 5 of 5

Thread: how to stop Form Validation on only one transition

  1. #1
    Join Date
    Mar 2011
    Posts
    166

    Default 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?
    Code:
    <view-state id="helloworld" view="input.jsp" model="customer" popup="true">
        		<transition on="submit" to="preview" />
        		<transition on="cancel" to="thanks"/>
    </view-state>
    Last edited by JohnTheDroider; Jul 25th, 2012 at 09:02 AM.

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    Please use [ code][/code ] tags when posting code and please take the time to read the reference guide, the section called 'Suppressing validation' should be a give away.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Mar 2011
    Posts
    166

    Default

    thanks Marten Deinum,

    i was looking for it and could not find it but you just pointed me to it.. thanks again

  4. #4
    Join Date
    Mar 2011
    Posts
    166

    Default

    I ran into a issue this does not cancel back to the pre-view
    Code:
    <view-state id="address" view="input2.jsp" model="customer">
                
    			<binder>
    				<binding property="address" required="true"/>
    				<binding property="city" />
    				<binding property="state" />
    				<binding property="zipCode" />
    			</binder>
        		<transition on="submit" to="preview" />
        		<transition on="cancel" to="name" validate="false" />
    	</view-state>

  5. #5
    Join Date
    May 2012
    Posts
    13

    Default

    use on your button tag immediate=true which skips amongst other things the validation...(if you are using jsf)


    Code:
    <h:commandButton immediate="true" ...../>

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •