Hi,

On Sun, Apr 1, 2012 at 4:18 AM, Emmanouil Batsis (Manos) <ma...@abiss.gr> wrote:
>
> I have a usecase for saving a draft of a form before actually submitting it.
>
> I'm trying to figure out how to only skip the "required" validators using a
> "save draft" submit button in my form. Disabling default form processing
> sounds like using a bazooka to shoot down a fly considering my form has a
> dynamic number of fields etc.
>
> My only thought so far is to keep a reference of mandatory fields and call
> their setRequired with false within the submit button's onSubmit.
>
> Would that work? Is there a better way?

Wont work. onSubmit() is called later than the validators.

Use the bazooka instead :-)
Set button's default processing to false, then in onSubmit visit all
form components and call convertInput() + updateModel() for each,
finally save them.

>
> Cheers,
>
> Maons
>
> ---------------------------------------------------------------------
> 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