Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Note
titleDifferent CQ modes
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:

AttributeDescriptionRequired?
objectobject that needs to be validated(tick)
titleHeading of validation messages displayed to authors, "Validation messages:" by default(error)
displayErrorsDefines if error messages should be displayed or not. The boolean value which should be based on CQ mode(error)
varVariable where validation result will be stored for further use(error)

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.

...