Two submit buttons in a form, one of them does not trigger validation

2012-03-21 Thread stoupa
I have a form that has two submit buttons. One is a Save button that just persists the model object of the form and the other is a Send for approval button that causes the data in the form to be processed in the application. I need to make some of the fields mandatory, but there is a requirement

Re: Two submit buttons in a form, one of them does not trigger validation

2012-03-21 Thread Martin Grigorov
Hi, We needed once to do something similar and we came with the following solution: override FormComponent#validate() for the components which have validators and do: public void validate() { if (getForm().findSubmittingButton() != saveButton) { super.validate() } } i.e. validate for

Re: Two submit buttons in a form, one of them does not trigger validation

2012-03-21 Thread Martin Grigorov
On Wed, Mar 21, 2012 at 6:10 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: button.setdefaultformprocessing(false) ? He needs to save the values without validation. Calling button.setdefaultformprocessing(false) wont update the models. -igor On Wed, Mar 21, 2012 at 3:30 AM, Martin

Re: Two submit buttons in a form, one of them does not trigger validation

2012-03-21 Thread Igor Vaynberg
yeah, but its pretty easy to visit all formcomponents and call convertinput()/updatemodel() from one place rather then changing every form component to be aware of the button...just sayin... -igor On Wed, Mar 21, 2012 at 9:22 AM, Martin Grigorov mgrigo...@apache.org wrote: On Wed, Mar 21, 2012