This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Partial submission/ Bypass validation  RSS feed

 
Bishal Ghimire
Greenhorn
Posts: 26
Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a form where there are two buttons- save and submit. I am successfully submitting the page but I have a problem while saving the form. "Save" should allow me to save whatever filled in the page. There might be fields which has "required" attribute "true". But, when someone clicks save, it shouldn't care about required field. How would I achieve in JSF 1.2/richfaces 3.3?

Any help would be appreciated?

 
Tim Holloway
Bartender
Posts: 18704
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Required means required. Not "required only when I click this button". Using RichFaces, you can limit the part of the page submit to omit some "required" controls from the data passed to the JSF lifecycle by use of the a4j:region element, but that isn't going to help if you have required and non-required items in the same region.

For that, you have to do things the hard way. Take the "required" attribute off the optional items and check them in the action processor instead.
 
Bishal Ghimire
Greenhorn
Posts: 26
Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean- instead of having required= "true", I have to have action Listener where it checks required field? I am not sure if that wrks, I need to save whatever have filled in the page and retireve them later.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!