Interface IValidatorAddListener

All Superinterfaces:
IClusterable, Serializable

public interface IValidatorAddListener
extends IClusterable

Optional interface for validators (IValidator and IFormValidator) that can react when validators are added to a Component.

Implementation note: currently we keep this case simple, stupid, and non-generic. In future versions we may revisit this and support removal events (IF removal of validators is ever allowed, which justifies its own discussion). Also, we may look at whether this is a common event to support for IBehaviors as well. This raises additional questions that need to be answered, hence we'll start by supporting just the use case when validators are added to forms or form components.

Eelco Hillenius

Method Summary
 void onAdded(Component component)
          Called right after a validator is added to a Form or FormComponent.

Method Detail


void onAdded(Component component)
Called right after a validator is added to a Form or 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.

component - a Component to which the validator was just added

Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.