Why does it have to do this:
final long longValue = Long.parseLong(value);
And later on again. That is a bit stupid.
I also think that the right flow is:
formcomponent.isRequired()
formcomponent.convert()
formcomponent.validate();
And validators always get the converted value.
I had already requiest for this (and it was on my todo to look at it one time)
To take updateModel (where the conversion now sits in) apart.
so that devs can get the converted value.
johan
On 2/27/06, Igor Vaynberg
<[EMAIL PROTECTED]> wrote:
whats left on that todo list you were tracking?
-IgorOn 2/27/06, Martijn Dashorst < [EMAIL PROTECTED] > wrote:Hmm,
I think we should stop tinkering with 1.2 and move to a beta/rc release cycle.
Martijn
On 2/27/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> If it doesn't break backwards compatability I'm fine with putting it in 1.2 .
>
> Eelco
>
> On 2/27/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> > i have some stuff im working on that can benefit from this right now. any
> > particular reason why you want to wait until 1.3?
> >
> > -Igor
> >
> >
> > On 2/27/06, Eelco Hillenius < [EMAIL PROTECTED] > wrote:
> > > Yeah, that sounds good. For 1.3.
> > >
> > > Eelco
> > >
> > > > so maybe we reserve "required" and "validation" keys for both
> > situations.
> > > > if we add conversion to the workflow then validators can even assume
> > the
> > > > correct type. the workflow can be something like this:
> > > >
> > > > 1) check required
> > > > 2) convert if needed into some transient variable accessible through
> > > > getConvertedInput() ?
> > > > 3) run validators on the converted value
> > > >
> > > > that way conversion is also a preprocessing step like required and is
> > > > cleaner imho. we also only convert once which is good in case its
> > expensive.
> > > >
> > > > -Igor
> > > >
> > > >
> > > >
> > > > >
> > > > > 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?cmdlnk&kid0944&bid$1720&dat1642
> > > > > _______________________________________________
> > > > > Wicket-develop mailing list
> > > > > [email protected]
> > > > >
> > > >
> > https://lists.sourceforge.net/lists/listinfo/wicket-develop
> > > > >
> > > >
> > > >
> > >
> > >
> > > -------------------------------------------------------
> > > 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?cmdlnk&kid0944&bid$1720&dat1642
> > > _______________________________________________
> > > Wicket-develop mailing list
> > > [email protected]
> > >
> > https://lists.sourceforge.net/lists/listinfo/wicket-develop
> > >
> >
> >
>
>
> -------------------------------------------------------
> 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?cmdlnk&kid0944&bid$1720&dat1642
> _______________________________________________
> Wicket-develop mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
>
--
Living a wicket life...
Martijn Dashorst - http://www.jroller.com/page/dashorst
Wicket 1.1.1 is out: http://wicket.sourceforge.net/wicket-1.1
-------------------------------------------------------
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?cmdlnk&kid0944&bid$1720&dat1642
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
