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 Summary
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 Summary
Method Summary
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.
Methods inherited from class Object
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
Property Details
data
data: Map (read-only)
Provides optional data acquired during validation.
message
message: String
Provides an optional message in case of validation failure.
valid
valid: Boolean
States if the validation succeeded or failed.
Constructor Details
FormElementValidationResult(Boolean)
FormElementValidationResult(valid: Boolean )
Creates a FormElementValidationResult with given setting for the validity but without any message.
Parameters:
valid - the desired validity
FormElementValidationResult(Boolean, String)
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(Boolean, String, Map)
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
Method Details
addData(Object, Object)
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()
getData(): Map
Provides optional data acquired during validation.
Returns:
the data acquired during validation
getMessage()
getMessage(): String
Provides an optional message in case of validation failure.
Returns:
the message for validation failure
isValid()
isValid(): Boolean
States if the validation succeeded or failed.
Returns:
true if the validation succeeded
setMessage(String)
setMessage(message: String ): void
Sets an optional message in case of validation failure.
Parameters:
message - the message for validation failure
setValid(Boolean)
setValid(valid: Boolean ): void
Sets if the validation succeeded or failed.
Parameters:
valid - if the validation succeeded