...
Note | ||
---|---|---|
| ||
It should be noted that validation messages should not be displayed in publish, they should be displayed only in edit mode. To achieve this, displayErrors attribute should be set to true only in edit mode (see line 4 in above example) |
Sum up of attributes:
Attribute | Description | Required? |
---|---|---|
object | object that needs to be validated | |
title | Heading of validation messages displayed to authors, "Validation messages:" by default | |
displayErrors | Defines if error messages should be displayed or not. The boolean value which should be based on CQ mode | |
var | Variable where validation result will be stored for further use |
Blank values approach
There is a special case of validation where we'd like to inform authors that the component has not been edited yet and it needs author's attention. This is especially useful when an author drags and drops a new component onto paragraph system, and the component needs to render itself. Usually, such component cannot pass validation without being edited first what's resulting in displaying error messages. This can be, in turn, misleading for authors.
...