You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ryan Sonnek <ry...@gmail.com> on 2008/07/01 16:11:52 UTC

Re: Client side validation

Do any of the core validators actually implement this interface?
I have an issue filed in JIRA for the StringValidator.maximumLength()
validator to append the maxlength HTML attribute to form components.
https://issues.apache.org/jira/browse/WICKET-1310

This seems like a perfect place to implement this feature.

On Mon, Jun 30, 2008 at 12:53 PM, Eelco Hillenius <ee...@gmail.com>
wrote:

> > That's why we introduced IValidatorAddListener in the past if I
> > remember correctly. I validator that implements IValidatorAddListener
> > can add behaviors in the onAdded method, so it is already possible to
> > design validators that take care of both server- and client side
> > validation.
>
> Javadocs from that class:
>
> public interface IValidatorAddListener extends IClusterable
> {
>        /**
>         * Called right after a validator is added to a {@link Form} or
> {@link FormComponent}. A common
>         * use case for implementing this interface is for validators to add
> behaviors to implement
>         * client-side validation capabilities, e.g. through JavaScript,
> Ajax
> or just by adding a simple
>         * attribute modifier that sets a "maxlength" attribute.
>         *
>         * @param component
>         *            a <code>Component</code> to which the validator was
> just added
>         */
>        void onAdded(Component component);
> }
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Client side validation

Posted by Ryan Sonnek <ry...@gmail.com>.
Okay, I've attached a patch that adds the maxlength html attribute.
On Tue, Jul 1, 2008 at 11:24 AM, Eelco Hillenius <ee...@gmail.com>
wrote:

> On Tue, Jul 1, 2008 at 7:11 AM, Ryan Sonnek <ry...@gmail.com> wrote:
> > Do any of the core validators actually implement this interface?
>
> Not yet I think, but it's never to late :-)
>
> Eelco
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Client side validation

Posted by Eelco Hillenius <ee...@gmail.com>.
On Tue, Jul 1, 2008 at 7:11 AM, Ryan Sonnek <ry...@gmail.com> wrote:
> Do any of the core validators actually implement this interface?

Not yet I think, but it's never to late :-)

Eelco

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org