it checks if the required needs to be checked and if that is the case it
checks if the input is set


On Wed, Mar 19, 2008 at 10:32 PM, Vitaly Tsaplin <[EMAIL PROTECTED]>
wrote:

>  checkRequired () itself shouldn't be called at all unless
> setRequired is true...
>
> On Wed, Mar 19, 2008 at 9:43 PM, Johan Compagner <[EMAIL PROTECTED]>
> wrote:
> > and did you look at checkRequired?
> >
> >  public boolean checkRequired()
> >     {
> >         if (isRequired())
> >         {
> >
> >  On Wed, Mar 19, 2008 at 2:24 PM, Vitaly Tsaplin <
> [EMAIL PROTECTED]>
> >  wrote:
> >
> >
> >
> >  >   Hi guys,
> >  >
> >  >   According to the wicket javadoc the method checkRequired () of the
> >  > FormComponent class "...should typically only be called when
> >  > isRequired() returns true."
> >  >   But it seems to be different...
> >  >
> >  >        public final void validate()
> >  >        {
> >  >                validateRequired();  <<<-------------------- here
> >  >                if (isValid())
> >  >                {
> >  >                        convertInput();
> >  >
> >  >                        if (isValid() && isRequired() &&
> >  > getConvertedInput() == null &&
> >  > isInputNullable())
> >  >                        {
> >  >                                reportRequiredError();
> >  >                        }
> >  >
> >  >                        if (isValid())
> >  >                        {
> >  >                                validateValidators();
> >  >                        }
> >  >                }
> >  >        }
> >  >
> >  >        protected final void validateRequired()
> >  >        {
> >  >                if (!checkRequired())   <<<--------------------- and
> here
> >  >                {
> >  >                        reportRequiredError();
> >  >                }
> >  >        }
> >  >
> >  >   As you can see the checkRequired () is called unconditionally.
> >  >
> >  >   Vitaly
> >  >
> >  > ---------------------------------------------------------------------
> >  > 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