The problem with that is that the way messaging works will differ from
the way other validations work. What do you have in mind for that?

Another case we might consider are value conversions. Probably in 99%
of the cases people want a validation of this anyway, and currently we
are doing the conversion twice because of the seperation of the
validation and the model update. But we have the same problem with
messaging again here.

Eelco

On 2/27/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> yep, thats exactly the idea. we dont have to deprecate RequiredTextField, it
> can just call setRequired(true) in the constructor, its not doing much more
> then that now.
>
> -Igor
>
>
>
>  On 2/27/06, Johan Compagner <[EMAIL PROTECTED]> wrote:
> > so FormComponent:
> > public final void validate()
> >     {
> >         final int size = validators_size();
> >         for (int i = 0; i < size; i++)
> >         {
> >             validators_get(i).validate(this);
> >         }
> >     }
> >
> > would be come something like this:
> >
> > public final void validate()
> > {
> >    if(!Strings.isEmpty(getInput()))
> >    {
> >         final int size = validators_size();
> >         for (int i = 0; i < size; i++)
> >         {
> >             validators_get(i).validate(this);
> >         }
> >     }
> >     else if(isRequired())
> >     {
> >         // set error message
> >     }
> > }
> >
> > So validators then always can assume they really can do something.
> >
> > Then RequiredTextField could be depricated..
> >
> > Fine by me, i also think that require is more or less a property just like
> enabled or visible.
> >
> > johan
> >
> >
> >
> >
> >
> > On 2/27/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> > > im working on some form/validation stuff right now and it seems to me
> that it would be cleaner to remove the RequiredValidator and instead
> introduce a required property (flag) for a form component.
> > >
> > > there are a couple of reasons why i think this is better:
> > > 1) our validators will be cleaner. currently our validators dont know if
> null is a valid value so we always first check if the value is empty, and
> then if its not run the validator. take a look at PatternValidator:107. with
> this change validators wont run when the field is empty.
> > >
> > > 2) it is useful for other components to know if the field is required or
> not.
> > >
> > > what do you guys think?
> > >
> > > so instead of add(new
> TextField("foo").add(RequiredValidator.getInstance())) it will be add(new
> TextField("foo").setRequired(true));
> > >
> > > -Igor
> > >
> > >
> >
> >
>
>


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to