Page History
...
Validators ensure that field input is entered in correct format and length. For example, you can validate that an email address adheres to a syntax such as first.last@company.com
. You can add multiple validators to a field. The validators are executed like a chain, one after the other.
Table of Contents |
---|
Common validator properties
Simple validator definition:
...
<field name> | Name of field. | ||||||
| required Contains the validator definition. | ||||||
| required Arbitrary node name. Use a name that describes the validator type. | ||||||
| required Validator definition class. Use the fully-qualified class name. | ||||||
| optional Fully qualified name of the Java class that creates the validator. The class must implement
| ||||||
| optional Text displayed to the user on invalid input. Text string or message bundle key. | ||||||
| optional Message bundle for localized messages. This property can be set at dialog, form, tab or field level. | ||||||
| required for regex validation Regular expression pattern when using the |
List of validator definition classes
info.magnolia.ui.form.validator.definition.RegexpValidatorDefinition | Validates a regular expression given in the |
info.magnolia.ui.form.validator.definition.EmailValidatorDefinition | Validates an email address. Delegates to a Vaadin |
Custom regular expressions
The easiest custom validator is a regular expression. Use the
Javadoc resource link | ||||
---|---|---|---|---|
|
pattern
property....
Localtab Group | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Custom validators
To write your own validator class:
...
Javadoc resource link className info.magnolia.security.app.dialog.field.validator.UniqueUserNameValidator renderType asynchronous Javadoc resource link className info.magnolia.security.app.dialog.field.validator.UniqueUserNameValidatorFactory renderType asynchronous Javadoc resource link className info.magnolia.security.app.dialog.field.validator.UniqueUserNameValidatorDefinition renderType asynchronous
Checking for null values
Info | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|