File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Partial submission/ Bypass validation Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Partial submission/ Bypass validation" Watch "Partial submission/ Bypass validation" New topic
Author

Partial submission/ Bypass validation

Bishal Ghimire
Greenhorn

Joined: Feb 01, 2011
Posts: 26

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
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14456
    
    7

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Bishal Ghimire
Greenhorn

Joined: Feb 01, 2011
Posts: 26

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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Partial submission/ Bypass validation
 
Similar Threads
saving the data into database
Form Tokens
Dirty Forms
Getting an action method to run only after another action method completes
Skip form validation but update backing bean values