In each onSubmit button method, you call what you want, but don't forget to
setDefaultFormProcessing(false) on them. This way, no validation is made nor
models are updated. You have to control yourself inside onSubmit.

Call form.updateFormComponentModels();      (something like that)
To "Save & Exit"

And for the Finish button,  call validate(); and _after_ the
updateFormComponentModels...

I think this is it. :)

give  it a shot



On 10/16/07, Jesse Foster <[EMAIL PROTECTED]> wrote:
>
>
> Is there any way to enable/disable form validation based on which submit
> button I use?  My page displays surveys, which are essentially rows of
> radiogroups and corresponding radios displayed in table like
> fashion.  There
> are two buttons on the page, one called "Finish" that saves all the
> answers
> on the page and finalizes the survey so no further editing will
> occur.  The
> other button is "Save and Exit" which just saves the current set of
> answers,
> so even if a radiogroup has no answer I still want to update my model.  In
> one case with "Finish" I want to validate all radiogroups have an answer
> by
> using setRequired(true), while on the flip side with "Save and Exit" I
> don't
> need that validation.
>
> I thought of using setDefaultFormProcessing(false) on the "Save and Exit"
> button and then manually populating the form model but Wicket ties model
> populating to validation.  The updateModel() call in FormComponent simply
> calls getConvertedInput() to populate the model object.  ConvertedInput is
> assigned its value during validate().
>
> Only solution I can think of is to subclass RadioGroup and override
> updateModel() to convert the input and then set the model object.  If
> there
> is a cleaner or better way to do this please let me know.
> --
> View this message in context:
> http://www.nabble.com/Disable-form-validation-based-on-which-submit-button-used--tf4636406.html#a13241117
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Bruno Borges
Summa Technologies
www.summa-tech.com
55 11 85657739  /  55 11 30552054

"The glory of great men should always be
measured by the means they have used to
acquire it."
- Francois de La Rochefoucauld

Reply via email to