Validation
Validation is provided by Ajv.
If you encounter some behavior that you don't understand, you can activate some debug logs with localStorage.debug = 'jl:validation'.
Simple errors
Errors on a simple property trigger a different rendering and the message is displayed.
Custom error messages
It is possible to overwrite standard error messages thanks to ajv-errors.
Section errors
If an error is related to a section but cannot be rendered on a child simple property it is displayed as part of the header of the section.
Composite errors
Composite components like tabs and expansion panels will signal errors inside one child using color and other accenting methods.
Validate on event
Validation of the data is always calculated, but an additional information validated is used to determine if an error message should actually be displayed.
The validated property of a simple property is true if:
- the whole form was validated
- or
options.initialValidation="always" - or
options.initialValidation="withData"and the property is initialized with non-empty data - or
options.validateOn="input"and the user inputed some data - or
options.validateOn="blur"and the user focused on the property then left
The option initialValidation can have the values never, withData and always (default is withData).
The option validateOn can have the values input, blur and submit (default is input).