I am not sure but I suspect that if the method checkRequired
returns true a requirement condition must always met in any case or
the behavior is different?
On Mon, Mar 17, 2008 at 8:57 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> why should we call checkrequired() twice?
>
> -igor
>
>
> On Mon, Mar 17, 2008 at 12:06 PM, Vitaly Tsaplin
>
>
> <[EMAIL PROTECTED]> wrote:
> > It should be probably like this
> >
> > if (isValid() && (isRequired() ? !checkRequired
> > () : true) && getConvertedInput() == null && isInputNullable())
> >
> > <<<<---- the second check. Doesn't call the chechRequired ()
> > {
> > reportRequiredError();
> > }
> >
> > On Mon, Mar 17, 2008 at 8:02 PM, Vitaly Tsaplin
> >
> >
> > <[EMAIL PROTECTED]> wrote:
> > > But if checkRequired () returns true isRequired () called again
> > > generating a validation error...
> > >
> > >
> > > if (isValid() && isRequired() &&
> > > getConvertedInput() == null && isInputNullable()) <<<<---- the second
> > > check. Doesn't call the chechRequired ()
> > > {
> > > reportRequiredError();
> > > }
> > >
> > >
> > >
> > >
> > > On Mon, Mar 17, 2008 at 7:47 PM, Igor Vaynberg <[EMAIL PROTECTED]>
> wrote:
> > > > sure it does, see the first line of validate()
> > > >
> > > > -igor
> > > >
> > > >
> > > >
> > > >
> > > > On Mon, Mar 17, 2008 at 11:06 AM, Vitaly Tsaplin
> > > > <[EMAIL PROTECTED]> wrote:
> > > > > Hi guys,
> > > > >
> > > > > It seams that there is a bug in the FormComponent code. I try
> to
> > > > > override chechRequired method but it seams to not work at all.
> > > > > Here is a snippet from the sources. As you can see there is a
> > > > > second requirement check.
> > > > >
> > > > > /**
> > > > > * Checks if the raw input value is not null if this
> component is required.
> > > > > */
> > > > > protected final void validateRequired()
> > > > > {
> > > > > if (!checkRequired()) <<<<---- the first check
> > > > > {
> > > > > reportRequiredError();
> > > > > }
> > > > > }
> > > > >
> > > > > /**
> > > > > * Performs full validation of the form component, which
> consists of
> > > > > calling validateRequired(),
> > > > > * convertInput(), and validateValidators(). This method
> should only
> > > > > be used if the form
> > > > > * component needs to be fully validated outside the form
> process.
> > > > > */
> > > > > public final void validate()
> > > > > {
> > > > > validateRequired();
> > > > > if (isValid())
> > > > > {
> > > > > convertInput();
> > > > >
> > > > > if (isValid() && isRequired() &&
> > > > > getConvertedInput() == null && isInputNullable()) <<<<---- the
> second
> > > > > check. Doesn't call the chechRequired ()
> > > > > {
> > > > > reportRequiredError();
> > > > > }
> > > > >
> > > > > if (isValid())
> > > > > {
> > > > > validateValidators();
> > > > > }
> > > > > }
> > > > > }
> > > > >
> > > > > 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]
> > > >
> > > >
> > >
> >
> > ---------------------------------------------------------------------
> > 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]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]