The validations occur on a page submit. Are you submitting the page on the submit or are you just redirecting to another url?
Otherwise to skip certain fields for validation - http://myfaces.apache.org/
Main Topics
Browse All TopicsHi,
Using JSF 1.2 I have a page that has some required fields on it, there are also 2 buttons, Accept and Cancel. Accept is fine because I want the required fields so be checked for values, but when the user presses the Cancel button I don't want the required fields checked for values.
Because this page is part of a page flow, I seem to have to make Cancel a button of type Submit, which causes the fields to be checked. I also tried setting it to a type Button, same issue.
Thanks
Chris
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
The validations occur on a page submit. Are you submitting the page on the submit or are you just redirecting to another url?
Otherwise to skip certain fields for validation - http://myfaces.apache.org/
karanw:
When I say the flow gets followed when you press the cancel button, what I mean is that when the cancel button is pressed it calls an action that returns "cancel" which causes the page flow to navigate back to the previous page.
a_b:
How do I make a button just do a redirect without submitting?
Here is someone who is trying to do the same thing - http://forums.sun.com/thre
Yes tried immediate = "true". To be honest I don't get what this does, it seems really seems to be erratic in the way that it works. The only time i find this useful is if I am using a modal window and I want the action to run before the onshow. Apart form that it's hit and miss.
I'm puzzled as to why what I am doing is so unusual, how do people normally do this?
God I miss Stuts!
Typically we control navigation through the navigation rule
So in the button click we call a bean in which say we have
nextPage = "thankyou"; and in the faces-config file
<navigation-case>
<from-outcome>thankyou</from-
<to-view-id>/pages/thankyou.
<redirect/>
</navigation-case>
Hope you are doing this
Yes that is what I am doing. The issue is that the page I am starting at has some required fields, the cancel button calls an action that returns "cancel". The navigation rule says that in the case of cancel being returned then go to page A. The problem is that the action is never called because the cancel button is a submit button which causes the page to be validated. Since not all of the required fields have been completed by the user (since they hit cancel because they don't want to complete the fields) so the validation failure prevents the action from being called. I would have thought that setting immediate="true" on the button would have fixed it, but this property in my experience is flaky at best.
Business Accounts
Answer for Membership
by: karanwPosted on 2009-08-19 at 20:21:35ID: 25139169
you want to follow same flow even if you click cancel button.
There should be another servlet or another flow for cancel where checking of values does not come into picture.