You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Igor Vaynberg <ig...@gmail.com> on 2007/11/12 06:10:27 UTC

bug in formcomponent.validate()

just so i am reading this right

FormComponent:1018

if (isValid() && isRequired() && getConvertedInput() == null &&
isInputNullable())
{
reportRequiredError();
}

that should actually be ( ! isInputNullable() ) no? wanted to make
sure i wasnt smoking something before i made the change and broke a
bunch of apps out there...

-igor

Re: bug in formcomponent.validate()

Posted by Johan Compagner <jc...@gmail.com>.
i guess in the past there was something that really tested for a request
param?

But what to do then? remove the isInputNullable() from the if?
(negating it doesn't make any sense)

But i guess then we have a problem with disabled textfields.

johan



On Nov 12, 2007 10:12 PM, Igor Vaynberg <ig...@gmail.com> wrote:

> well yes, but look at the check
>
> > > > > if (isValid() && isRequired() && getConvertedInput() == null &&
> > > > > isInputNullable())
> > > > > {
> > > > > reportRequiredError();
> > > > > }
>
> we have a required component
> it is nullable = null is ok
> it converts some string input - * which we already know WASNT empty into
> null *
>
> does that then trigger a required error?
>
> with this logic we cannot have a required nullable component...
>
> -igor
>
>
>
> On Nov 12, 2007 10:37 AM, Johan Compagner <jc...@gmail.com> wrote:
> > to me it does the method isInputNullable() doesn't say that the current
> > input is null or not
> > It says can the input be nullable at one point or not.  So check for
> that
> > and then if it is
> > really null or not sounds quite reasonable right?
> >
> >
> >
> >
> > On Nov 12, 2007 6:45 PM, Igor Vaynberg <ig...@gmail.com> wrote:
> >
> > > On Nov 12, 2007 12:24 AM, Johan Compagner <jc...@gmail.com>
> wrote:
> > > > no i think that if is right.
> > > >
> > > > because only if the component is nullable then the isRequiredCheck
> has
> > > to be
> > > > done
> > > > Else if a textfield (which isn't nullable) will report an error when
> it
> > > is
> > > > disabled in html
> > > >
> > > > if we test on !isInputNullable then getConvertedInput() couldn't
> return
> > > > null...
> > >
> > > well yeah...if a component is nullable and getconvertedinput() returns
> > > null that should be ok - no need to check if its required or not...
> > >
> > > maybe these names are bad, but to me it doesnt make any sense
> > >
> > > -igor
> > >
> > >
> > >
> > >
> > > >
> > > > johan
> > > >
> > > >
> > > >
> > > >
> > > > On Nov 12, 2007 6:10 AM, Igor Vaynberg <ig...@gmail.com>
> wrote:
> > > >
> > > > > just so i am reading this right
> > > > >
> > > > > FormComponent:1018
> > > > >
> > > > > if (isValid() && isRequired() && getConvertedInput() == null &&
> > > > > isInputNullable())
> > > > > {
> > > > > reportRequiredError();
> > > > > }
> > > > >
> > > > > that should actually be ( ! isInputNullable() ) no? wanted to make
> > > > > sure i wasnt smoking something before i made the change and broke
> a
> > > > > bunch of apps out there...
> > > > >
> > > > > -igor
> > > > >
> > > >
> > >
> >
>

Re: bug in formcomponent.validate()

Posted by Igor Vaynberg <ig...@gmail.com>.
well yes, but look at the check

> > > > if (isValid() && isRequired() && getConvertedInput() == null &&
> > > > isInputNullable())
> > > > {
> > > > reportRequiredError();
> > > > }

we have a required component
it is nullable = null is ok
it converts some string input - * which we already know WASNT empty into null *

does that then trigger a required error?

with this logic we cannot have a required nullable component...

-igor



On Nov 12, 2007 10:37 AM, Johan Compagner <jc...@gmail.com> wrote:
> to me it does the method isInputNullable() doesn't say that the current
> input is null or not
> It says can the input be nullable at one point or not.  So check for that
> and then if it is
> really null or not sounds quite reasonable right?
>
>
>
>
> On Nov 12, 2007 6:45 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>
> > On Nov 12, 2007 12:24 AM, Johan Compagner <jc...@gmail.com> wrote:
> > > no i think that if is right.
> > >
> > > because only if the component is nullable then the isRequiredCheck has
> > to be
> > > done
> > > Else if a textfield (which isn't nullable) will report an error when it
> > is
> > > disabled in html
> > >
> > > if we test on !isInputNullable then getConvertedInput() couldn't return
> > > null...
> >
> > well yeah...if a component is nullable and getconvertedinput() returns
> > null that should be ok - no need to check if its required or not...
> >
> > maybe these names are bad, but to me it doesnt make any sense
> >
> > -igor
> >
> >
> >
> >
> > >
> > > johan
> > >
> > >
> > >
> > >
> > > On Nov 12, 2007 6:10 AM, Igor Vaynberg <ig...@gmail.com> wrote:
> > >
> > > > just so i am reading this right
> > > >
> > > > FormComponent:1018
> > > >
> > > > if (isValid() && isRequired() && getConvertedInput() == null &&
> > > > isInputNullable())
> > > > {
> > > > reportRequiredError();
> > > > }
> > > >
> > > > that should actually be ( ! isInputNullable() ) no? wanted to make
> > > > sure i wasnt smoking something before i made the change and broke a
> > > > bunch of apps out there...
> > > >
> > > > -igor
> > > >
> > >
> >
>

Re: bug in formcomponent.validate()

Posted by Johan Compagner <jc...@gmail.com>.
to me it does the method isInputNullable() doesn't say that the current
input is null or not
It says can the input be nullable at one point or not.  So check for that
and then if it is
really null or not sounds quite reasonable right?



On Nov 12, 2007 6:45 PM, Igor Vaynberg <ig...@gmail.com> wrote:

> On Nov 12, 2007 12:24 AM, Johan Compagner <jc...@gmail.com> wrote:
> > no i think that if is right.
> >
> > because only if the component is nullable then the isRequiredCheck has
> to be
> > done
> > Else if a textfield (which isn't nullable) will report an error when it
> is
> > disabled in html
> >
> > if we test on !isInputNullable then getConvertedInput() couldn't return
> > null...
>
> well yeah...if a component is nullable and getconvertedinput() returns
> null that should be ok - no need to check if its required or not...
>
> maybe these names are bad, but to me it doesnt make any sense
>
> -igor
>
>
>
>
> >
> > johan
> >
> >
> >
> >
> > On Nov 12, 2007 6:10 AM, Igor Vaynberg <ig...@gmail.com> wrote:
> >
> > > just so i am reading this right
> > >
> > > FormComponent:1018
> > >
> > > if (isValid() && isRequired() && getConvertedInput() == null &&
> > > isInputNullable())
> > > {
> > > reportRequiredError();
> > > }
> > >
> > > that should actually be ( ! isInputNullable() ) no? wanted to make
> > > sure i wasnt smoking something before i made the change and broke a
> > > bunch of apps out there...
> > >
> > > -igor
> > >
> >
>

Re: bug in formcomponent.validate()

Posted by Igor Vaynberg <ig...@gmail.com>.
On Nov 12, 2007 12:24 AM, Johan Compagner <jc...@gmail.com> wrote:
> no i think that if is right.
>
> because only if the component is nullable then the isRequiredCheck has to be
> done
> Else if a textfield (which isn't nullable) will report an error when it is
> disabled in html
>
> if we test on !isInputNullable then getConvertedInput() couldn't return
> null...

well yeah...if a component is nullable and getconvertedinput() returns
null that should be ok - no need to check if its required or not...

maybe these names are bad, but to me it doesnt make any sense

-igor




>
> johan
>
>
>
>
> On Nov 12, 2007 6:10 AM, Igor Vaynberg <ig...@gmail.com> wrote:
>
> > just so i am reading this right
> >
> > FormComponent:1018
> >
> > if (isValid() && isRequired() && getConvertedInput() == null &&
> > isInputNullable())
> > {
> > reportRequiredError();
> > }
> >
> > that should actually be ( ! isInputNullable() ) no? wanted to make
> > sure i wasnt smoking something before i made the change and broke a
> > bunch of apps out there...
> >
> > -igor
> >
>

Re: bug in formcomponent.validate()

Posted by Johan Compagner <jc...@gmail.com>.
no i think that if is right.

because only if the component is nullable then the isRequiredCheck has to be
done
Else if a textfield (which isn't nullable) will report an error when it is
disabled in html

if we test on !isInputNullable then getConvertedInput() couldn't return
null...

johan



On Nov 12, 2007 6:10 AM, Igor Vaynberg <ig...@gmail.com> wrote:

> just so i am reading this right
>
> FormComponent:1018
>
> if (isValid() && isRequired() && getConvertedInput() == null &&
> isInputNullable())
> {
> reportRequiredError();
> }
>
> that should actually be ( ! isInputNullable() ) no? wanted to make
> sure i wasnt smoking something before i made the change and broke a
> bunch of apps out there...
>
> -igor
>