| Package | mx.validators | 
| Interface | public interface IValidator | 
| Implementors | GlobalizationValidatorBase, Validator | 
| Language Version: | ActionScript 3.0 | 
| Product Version: | Flex 4.5 | 
| Runtime Versions: | Flash Player 10, AIR 1.5 | 
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.
Related API Elements
spark.validators.GlobalizationValidatorBase
| Property | Defined By | ||
|---|---|---|---|
| enabled : Boolean 
      Property to enable/disable validation process. | IValidator | ||
| Method | Defined By | ||
|---|---|---|---|
| 
      Performs validation and optionally notifies
      the listeners of the result. | IValidator | ||
| enabled | property | 
enabled:Boolean| Language Version: | ActionScript 3.0 | 
| Product Version: | Flex 4.5 | 
| Runtime Versions: | Flash Player 10.1, AIR 2.0 | 
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.
 The default value is true.
Implementation
    public function get enabled():Boolean    public function set enabled(value:Boolean):void| validate | () | method | 
 public function validate(value:Object = null, suppressEvents:Boolean = false):ValidationResultEvent| Language Version: | ActionScript 3.0 | 
| Product Version: | Flex 4.5 | 
| Runtime Versions: | Flash Player 10.1, AIR 2.5 | 
Performs validation and optionally notifies the listeners of the result.
Parameters
| value:Object(default =null)— Optional value to validate.
      If null, then the validator uses thesourceandpropertyproperties to determine the value.
      If you specify this argument, you should also set thelistenerproperty to specify the target component
      for any validation error messages. | |
| suppressEvents:Boolean(default =false)— Iffalse, then after validation,
      the validator will notify the listener of the result. | 
| ValidationResultEvent— A ValidationResultEvent object
      containing the results of the validation. 
      For a successful validation, theValidationResultEvent.resultsArray property is empty. 
      For a validation failure, theValidationResultEvent.resultsArray 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 theValidationResult.isErrorproperty to determine if the field passed or failed the validation. | 
Related API Elements
Thu Dec 4 2014, 05:50 PM -08:00