This interface specifies the methods and properties that a Validator object must implement.
This interface allows to validate multiple data
types like numbers, currency, phone numbers, zip codes etc that
are defined in both mx and spark namespaces. The classes
mx:Validator and spark:GlobaliationValidatorBase
implement this interface. The validateAll() method in these classes use
this interface type to call the validate() method on
multiple validator objects.
See also:
Variables
enabled:Bool
Property to enable/disable validation process.
Setting this value to false
will stop the validator
from performing validation.
When a validator is disabled, it dispatches no events,
and the validate()
method returns null.
Methods
validate(?value:Dynamic, suppressEvents:Bool = false):ValidationResultEvent
Performs validation and optionally notifies the listeners of the result.
Parameters:
value | Optional value to validate.
If null, then the validator uses the |
---|---|
suppressEvents | If |
Returns:
A ValidationResultEvent object
containing the results of the validation.
For a successful validation, the
ValidationResultEvent.results
Array property is empty.
For a validation failure, the
ValidationResultEvent.results
Array property contains
one ValidationResult object for each field checked by the validator,
both for fields that failed the validation and for fields that passed.
Examine the ValidationResult.isError
property to determine if the field passed or failed the validation.
See also:
feathers.events.ValidationResultEvent