Bypass Required Field Validation on Commit

I have a form that has a number of required components. At the bottom of the form, I have two buttons:

“Save And Exit” and “Continue”

If the user presses “Continue”, I want to have the form validate all of the fields and populate the underlying BeanItem. If the validation fails, then I want to stop the user from continuing.

However, if the user presses “Save And Exit”, I want the underlying BeanItem to be populated, but not throw an exception if required fields are NOT filled in. Is there a way to tell commit to populate the BeanItem, but ignore the empty required fields?

Thanks,
Tom

Well there is no “required but it depends”. I’m afraid you have to implement your own validation.

Remove the validators of Fields before call commit.
You can build a factory, or a helper method, to automate it for you.