Pacchetto | mx.validators |
Interfaccia | public interface IValidator |
Implementatori | GlobalizationValidatorBase, Validator |
Versione linguaggio: | ActionScript 3.0 |
Versione prodotto: | Flex 4.5 |
Versioni runtime: | 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.
Elementi API correlati
spark.validators.GlobalizationValidatorBase
Proprietà | Definito da | ||
---|---|---|---|
enabled : Boolean
Property to enable/disable validation process. | IValidator |
Metodo | Definito da | ||
---|---|---|---|
Performs validation and optionally notifies
the listeners of the result. | IValidator |
enabled | proprietà |
enabled:Boolean
Versione linguaggio: | ActionScript 3.0 |
Versione prodotto: | Flex 4.5 |
Versioni runtime: | 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.
Il valore predefinito è true.
Implementazione
public function get enabled():Boolean
public function set enabled(value:Boolean):void
validate | () | metodo |
public function validate(value:Object = null, suppressEvents:Boolean = false):ValidationResultEvent
Versione linguaggio: | ActionScript 3.0 |
Versione prodotto: | Flex 4.5 |
Versioni runtime: | Flash Player 10.1, AIR 2.5 |
Performs validation and optionally notifies the listeners of the result.
Parametri
value:Object (default = null ) — Optional value to validate.
If null, then the validator uses the source and
property properties to determine the value.
If you specify this argument, you should also set the
listener property to specify the target component
for any validation error messages.
| |
suppressEvents:Boolean (default = false ) — If false , 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, 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.
|
Elementi API correlati
Tue Jun 12 2018, 02:44 PM Z