<mx:DateValidator>
tag
inherits all of the tag attributes of its superclass,
and adds the following tag attributes:
<mx:DateValidator allowedFormatChars="/\-. " dayListener="Object specified by daySource" dayProperty="No default" daySource="No default" formatError= "Configuration error: Incorrect formatting string." inputFormat="MM/DD/YYYY" invalidCharError="The date contains invalid characters." monthListener="Object specified by monthSource" monthProperty="No default" monthSource="No default" validateAsString="true|false" wrongDayError="Enter a valid day for the month." wrongLengthError="Type the date in the format inputFormat." wrongMonthError="Enter a month between 1 and 12." wrongYearError="Enter a year between 0 and 9999." yearListener="Object specified by yearSource" yearProperty="No default" yearSource="No default" />]]>
Sie haben für die Angabe des Datums in der DateValidator-Klasse zwei Möglichkeiten:
Diese Methode wird nicht direkt aufgerufen; Flex ruft sie als Teil einer Überprüfung auf. Wenn Sie eine benutzerdefinierte Validator-Klasse erstellen, müssen Sie diese Methode implementieren.
<mx:ZipCodeValidator>
tag
inherits all of the tag attributes of its superclass,
and adds the following tag attributes:
<mx:ZipCodeValidator allowedFormatChars=" -" domain="US Only | US or Canada | Canada Only" invalidCharError="The ZIP code contains invalid characters." invalidDomainError="The domain parameter is invalid. It must be either 'US Only', 'Canada Only', or 'US or Canada'." wrongCAFormatError="The Canadian postal code must be formatted 'A1B 2C3'." wrongLengthError="The ZIP code must be 5 digits or 5+4 digits." wrongUSFormatError="The ZIP+4 code must be formatted '12345-6789'." />]]>
Diese Methode wird nicht direkt aufgerufen; Flex ruft sie als Teil einer Überprüfung auf. Wenn Sie eine benutzerdefinierte Validator-Klasse erstellen, müssen Sie diese Methode implementieren.
In ActionScript können Sie die nachstehenden Konstantenverwenden, um diese Eigenschaft zu setzen:
Über diese Schnittstelle können mehrere Datentypen wie Zahlen, Währungen, Telefonnummern, Postleitzahlen usw, die in mx- und spark-Namespaces definiert sind, überprüft werden. Die Klassen mx:Validator und spark:GlobaliationValidatorBase implementieren diese Schnittstelle. Die validateAll()-Methode in diesen Klassen verwendet diesen Schnittstellentyp zum Aufrufen der validate()-Methode für mehrere Validator-Objekte.
Wird dieser Wert auf
<mx:CurrencyValidator>
tag
inherits all of the tag properties of its superclass,
and adds the following tag properties:
<mx:CurrencyValidator alignSymbol="left|right|any" allowNegative="true|false" currencySymbol="$" currencySymbolError="The currency symbol occurs in an invalid location." decimalPointCountError="The decimal separator can occur only once." decimalSeparator="." exceedsMaxError="The amount entered is too large." invalidCharError="The input contains invalid characters." invalidFormatCharsError="One of the formatting parameters is invalid." lowerThanMinError="The amount entered is too small." maxValue="NaN" minValue="NaN" negativeError="The amount may not be negative." precision="2" precisionError="The amount entered has too many digits beyond the decimal point." separationError="The thousands separator must be followed by three digits." thousandsSeparator="," />]]>
Diese Methode wird nicht direkt aufgerufen; Flex ruft sie als Teil einer Überprüfung auf. Wenn Sie eine benutzerdefinierte Validator-Klasse erstellen, müssen Sie diese Methode implementieren.
<mx:StringValidator>
tag
inherits all of the tag attributes of its superclass,
and add the following tag attributes:
<mx:StringValidator maxLength="NaN" minLength="NaN" tooLongError="This string is longer than the maximum allowed length. This must be less than {0} characters long." tooShortError="This string is shorter than the minimum allowed length. This must be at least {0} characters long." />]]>
Diese Methode wird nicht direkt aufgerufen; Flex ruft sie als Teil einer Überprüfung auf. Wenn Sie eine benutzerdefinierte Validator-Klasse erstellen, müssen Sie diese Methode implementieren.
<mx:RegExpValidator>
tag
inherits all of the tag attributes of its superclass,
and adds the following tag attributes:
<mx:RegExpValidator expression="No default" flags="No default" noExpressionError="The expression is missing." noMatchError="The field is invalid." />]]>
Die Überprüfung ist erfolgreich, wenn der Validator im zu überprüfenden Feld eine Übereinstimmung für den regulären Ausdruck findet. Ein Überprüfungsfehler wird ausgegeben, wenn der Validator kein Ergebnis findet.
Die RegExpValidator-Klasse löst die
Für ein
Diese Methode wird nicht direkt aufgerufen; Flex ruft sie als Teil einer Überprüfung auf. Wenn Sie eine benutzerdefinierte Validator-Klasse erstellen, müssen Sie diese Methode implementieren.
<mx:NumberValidator>
tag
inherits all of the tag attributes of its superclass,
and adds the following tag attributes:
<mx:NumberValidator allowNegative="true|false" decimalPointCountError="The decimal separator can only occur once." decimalSeparator="." domain="real|int" exceedsMaxError="The number entered is too large." integerError="The number must be an integer." invalidCharError="The input contains invalid characters." invalidFormatCharsError="One of the formatting parameters is invalid." lowerThanMinError="The amount entered is too small." maxValue="NaN" minValue="NaN" negativeError="The amount may not be negative." precision="-1" precisionError="The amount entered has too many digits beyond the decimal point." separationError="The thousands separator must be followed by three digits." thousandsSeparator="," />]]>
Diese Methode wird nicht direkt aufgerufen; Flex ruft sie als Teil einer Überprüfung auf. Wenn Sie eine benutzerdefinierte Validator-Klasse erstellen, müssen Sie diese Methode implementieren.
In ActionScript können Sie die folgenden Konstanten zum Festlegen dieser Eigenschaft verwenden:
<mx:PhoneNumberValidator>
tag
inherits all of the tag attributes of its superclass,
and adds the following tag attributes:
<mx:PhoneNumberValidator allowedFormatChars="()- .+" invalidCharError="Your telephone number contains invalid characters." minDigits="10" wrongLengthError="Your telephone number must contain at least 10 digits." />]]>
Normalerweise wird diese Methode nicht direkt, sondern von Flex als Teil einer Überprüfung aufgerufen. Wenn Sie eine benutzerdefinierte Validator-Klasse erstellen, müssen Sie diese Methode implementieren.
<mx:EmailValidator>
tag
inherits all of the tag attributes of its superclass,
and adds the following tag attributes:
<mx:EmailValidator invalidCharError="Your e-mail address contains invalid characters." invalidDomainError= "The domain in your e-mail address is incorrectly formatted." invalidIPDomainError="The IP domain in your e-mail address is incorrectly formatted." invalidPeriodsInDomainError="The domain in your e-mail address has consecutive periods." missingAtSignError="An at sign (&64;) is missing in your e-mail address." missingPeriodInDomainError="The domain in your e-mail address is missing a period." missingUsernameError="The username in your e-mail address is missing." tooManyAtSignsError="Your e-mail address contains too many &64; characters." />]]>
Sie können IP-Domänennamen verwenden, wenn sie in eckigen Klammern stehen, beispielsweise meinname@[206.132.22.1]. Sie können einzelne IP-Nummern von 0 bis 255 verwenden.
Diese Methode wird nicht direkt aufgerufen; Flex ruft sie als Teil einer Überprüfung auf. Wenn Sie eine benutzerdefinierte Validator-Klasse erstellen, müssen Sie diese Methode implementieren.
Für ein
Die ValidationResultEvent-Klasse bestimmt das Ereignisobjekt, das an den Ereignis-Listener für die
<mx:Validator enabled="true|false" listener="Value of the source property" property="No default" required="true|false" requiredFieldError="This field is required." source="No default" trigger="Value of the source property" triggerEvent="valueCommit" />]]>
Wenn Sie eine Validator-Unterklasse erstellen, müssen Sie diese Methode überschreiben.
Dieses Ereignis wird ausgelöst, wenn Sie die
Unterklassen sollten diese Methode überschreiben und nach dem Aufruf von
Unterklassen der Validator-Klasse, die mehrere Datenfelder überprüfen (wie z. B. CreditCardValidator und DateValidator), sollten diese Eigenschaft in ihrem Konstruktor zuweisen.
Wird kein Listener angegeben, verwendet Flex den Wert der
<mx:CreditCardValidator>
tag
inherits all of the tag attributes of its superclass,
and adds the following tag attributes:
<mx:CreditCardValidator allowedFormatChars=" -" cardNumberListener="Object specified by cardNumberSource" cardNumberProperty="No default" cardNumberSource="No default" cardTypeListener="Object specified by cardTypeSource" cardTypeProperty="No default" cardTypeSource="No default" invalidCharError= "Invalid characters in your credit card number. (Enter numbers only.)" invalidNumberError="The credit card number is invalid." noNumError="No credit card number is specified." noTypeError="No credit card type is specified or the type is not valid." wrongLengthError="Your credit card number contains the wrong number of digits." wrongTypeError="Incorrect card type is specified." />]]>
Sie haben für die Eingabe im CreditCardValidator zwei Möglichkeiten:
In MXML verwenden Sie die Werte:
In ActionScript verwenden Sie die statischen Konstanten
Für eine Überprüfung werden die nachstehenden Richtlinien verwendet:
Länge:
Diese Methode wird nicht direkt aufgerufen; Flex ruft sie als Teil einer Überprüfung auf. Wenn Sie eine benutzerdefinierte Validator-Klasse erstellen, müssen Sie diese Methode implementieren.
In MXML lauten die zulässigen Werte:
In ActionScript können Sie folgende Konstanten verwenden, um diese Eigenschaft festzulegen:
<mx:SocialSecurityValidator>
tag
inherits all of the tag attributes of its superclass,
and adds the following tag attributes:
<mx:SocialSecurityValidator allowedFormatChars=" -" invalidCharError="You entered invalid characters in your Social Security number." wrongFormatError="The Social Security number must be 9 digits or in the form NNN-NN-NNNN." zeroStartError="Invalid Social Security number; the number cannot start with 000." />]]>
Diese Methode wird nicht direkt aufgerufen; Flex ruft sie als Teil einer Überprüfung auf. Wenn Sie eine benutzerdefinierte Validator-Klasse erstellen, müssen Sie diese Methode implementieren.
Normalerweise verwalten Sie die
Sie können die
Um den Überprüfungsfehler zu löschen, schreiben Sie einen leeren String ("") in die
Beachten Sie, dass beim Schreiben eines Werts in die