concept common form field in category java

appears as: Common form field
Spring Roo in Action

This is an excerpt from Manning's book Spring Roo in Action.

Table 6.5. Common form field attributes

Attribute

Description

Field Type(s)

label The label to use to identify the field on the screen. This version is not localized, and is useful during prototyping or for applications that don’t need localization. all
labelCode As with label above, identifies the field on the screen. The label is interpolated using the localized properties files. all
required Whether the field is required to submit the form. If this value is set to true, and the field is skipped, the client-side JavaScript validators won’t allow the form to be submitted. This is a form of client-side validation. input, editor, textarea, datetime, select
disabled Whether the field can be edited. This may be useful if set based on user permissions using the Spring Security API or other databased permission scheme. input, editor, textarea, datetime, select
validationRegex
validationMessage
validationMesageCode
The regular expression defining the validation to apply for this field and the message to return when invalid.
The messageCode variant looks up the message in the localized property stream, and the message variant takes a literal error message.
Don’t forget to apply this pattern and message to both the create and update forms if you’re going to allow both creation and update editing of the field.
Example:
validationRegex="[A-Z,a-z ]*$"
validationMessage="Invalid Name"
input, textarea, editor, datetime