Providing error messages
Brightspot provides convenient APIs for displaying data validation and other error messages on the content edit form.
- Use IllegalArgumentException to display error messages at the top of the content edit form.
- Use State#addError to display error messages above a field.
ErrorMessages
-
Declares a field for entering a distance.
-
Performs data validation prior to saving the object. Brightspot provides several callback methods with which you can perform validation.
-
Checks if the editor entered a number.
-
Displays a detailed error message above the field
distanceFromEarth
. -
Displays a general error message at the top of the content edit form.