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 all buttons but the one you want to skip.

HTH

On Wed, Mar 21, 2012 at 12:03 PM, stoupa <vladimirkro...@gmail.com> wrote:
> 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 that
> the "Save" button should not trigger any validators, the user should always
> be able to save his form.
> Is there a clean way how to achieve this behaviour in Wicket? I'm using
> version 1.4.
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Two-submit-buttons-in-a-form-one-of-them-does-not-trigger-validation-tp4491781p4491781.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to