Class FormElementValidationResult
Represents a form element validation result. The validation script specified for form groups and fields can create such FormElementValidationResult with the desired validity, message and data and can then return it. The server side form element validation will evaluate these settings, i.e. calculate the corresponding element validity and message. The optional data provided with this instance will be kept and can be accessed again from the form element after server side validation.
| Property | Description |
|---|---|
data: Map (read-only) | Provides optional data acquired during validation. |
| message: String | Provides an optional message in case of validation failure. |
| valid: Boolean | States if the validation succeeded or failed. |
| Constructor | Description |
|---|---|
| FormElementValidationResult(Boolean) | Creates a FormElementValidationResult with given setting for the validity but without any message. |
| FormElementValidationResult(Boolean, String) | Creates a FormElementValidationResult with given setting for the validity and corresponding message. |
| FormElementValidationResult(Boolean, String, Map) | Creates a FormElementValidationResult with given setting for the validity and corresponding message. |
| Method | Description |
|---|---|
| addData(Object, Object) | Adds optional data acquired during validation. |
| getData() | Provides optional data acquired during validation. |
| getMessage() | Provides an optional message in case of validation failure. |
| isValid() | States if the validation succeeded or failed. |
| setMessage(String) | Sets an optional message in case of validation failure. |
| setValid(Boolean) | Sets if the validation succeeded or failed. |
assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values
- data: Map
(read-only) Provides optional data acquired during validation.
- message: String
Provides an optional message in case of validation failure.
- valid: Boolean
States if the validation succeeded or failed.
- FormElementValidationResult(valid: Boolean)
Creates a FormElementValidationResult with given setting for the validity but without any message.
Parameters:
- valid - the desired validity
- FormElementValidationResult(valid: Boolean, message: String)
Creates a FormElementValidationResult with given setting for the validity and corresponding message. This is especially useful to represent a failed validation including some error message.
Parameters:
- valid - the desired validity
- message - the desired message
- FormElementValidationResult(valid: Boolean, message: String, data: Map)
Creates a FormElementValidationResult with given setting for the validity and corresponding message. This is especially useful to represent a failed validation including some error message. Additional data can be stored, too.
Parameters:
- valid - the desired validity
- message - the desired message
- data - the desired data
- addData(key: Object, value: Object): void
Adds optional data acquired during validation.
Parameters:
- key - the key for which the data value will be stored
- value - the data value that is stored for the given key
- getData(): Map
Provides optional data acquired during validation.
Returns:
- the data acquired during validation
- getMessage(): String
Provides an optional message in case of validation failure.
Returns:
- the message for validation failure
- isValid(): Boolean
States if the validation succeeded or failed.
Returns:
- true if the validation succeeded
- setMessage(message: String): void
Sets an optional message in case of validation failure.
Parameters:
- message - the message for validation failure
- setValid(valid: Boolean): void
Sets if the validation succeeded or failed.
Parameters:
- valid - if the validation succeeded