validation is there to make sure the user of the webapp cannot push an
illegal value into a model. it doesnt matter if its just the component
that is being submitted or the entire form. components decide whether
or not a user can push null in by using their required flag. you want
to push null, dont mark the component as required. it is as simple as
that. you can create your own updating behavior that calls
setrequired(false) on the component prior to running validation/model
update if that is what you want. but we will not ship something like
this as part of core because it doesnt generally make sense.

-igor

On Thu, Feb 17, 2011 at 1:33 PM, Daniel Stoch <daniel.st...@gmail.com> wrote:
> On Thu, Feb 17, 2011 at 10:01 PM, Igor Vaynberg <igor.vaynb...@gmail.com> 
> wrote:
>> if you want to push a null value into a component you marked required
>> then dont mark it as required.
>
> No, because then I must have my own "customrequired" flags instead of
> using the core mechanism. I think this is wrong way.
> There is a wrong assumption that when component is marked as required
> then I cannot push a null value to its model. Validation should not
> allow to submit a form (not allow to further processing). But during
> editing process when user fills the form and "updates" componenets
> (not "submits" whole form) it should be possible to push null in
> models (of course as an option).
> The current behavior leads to many boilerplate code which can be avoided.
>
>> if you have inter-dependent validation
>> use a formvalidator or override form's onsubmit.
>
> It is not this case here.
>
> --
> Daniel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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

Reply via email to