On 8/13/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> > hrm, so lets see DateTimeField:
> >
> > public final boolean isRequired()
> >     {
> >         // prevent clients from overriding
> >         return super.isRequired();
> >     }
> >
> >     public FormComponent setRequired(boolean required)
> >     {
> >         dateField.setRequired(required);
> >         return this;
> >     }
> >
> >
> > isnt this broken? isrequired() doesnt return the same value as
> > setrequired().
>
> You you're right, this would be it:
>
>         public FormComponent setRequired(boolean required)
>         {
>                 super.setRequired(required);
>                 dateField.setRequired(required);
>                 return this;
>         }

I'd also like to point out that this bug only had an effect when
clients would call isRequired themselves, as for Wicket's functioning
it's not really relevant. And making the isRequired function final is
really to force people to use setRequired.

Eelco

Reply via email to