Also conditional validation might do it:
https://cwiki.apache.org/WICKET/conditional-validation.html

2011/2/17 Igor Vaynberg <[email protected]>:
> 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 <[email protected]> wrote:
>> On Thu, Feb 17, 2011 at 10:01 PM, Igor Vaynberg <[email protected]> 
>> 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: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to