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