Form Field Types
This appendix provides a list of form field types that is used to define the type of form fields during form creation in an open automation module. For defining a form field, it is mandatory to provide the label and type of the form field.
-
FIELD_TYPE_TEXT
The FIELD_TYPE_TEXT defines a field as text field. It is the default field type. If the field type is not defined for a form field annotation, the form field is categorized as text type by default.
Attributes -
maxLength—Specify the maximum number of character allowed in a text field.
-
Size—Set the size of the text field using one of the following values: -
FIELD_SIZE_SMALL
-
FIELD_SIZE_MEDIUM
-
FIELD_SIZE_LARGE
-
FIELD_SIZE_MEDIUM_SMALL
-
FIELD_SIZE_LARGE_SMALL
-
FIELD_SIZE_SMALL_MEDIUM
-
FIELD_SIZE_LARGE_MEDIUM
-
FIELD_SIZE_SMALL_LARGE
-
FIELD_SIZE_MEDIUM_LARGE
-
Sample @FormField(label = "Name", help = "Name", size =FormFieldDefinition.FIELD_SIZE_SMALL) private String name;
-
-
FIELD_TYPE_NUMBER
The FIELD_TYPE_NUMBER defines that a field should contain a numeric value.
Attributes -
minValue—Specify the minimum acceptable value for the numeric field. For example, 1.
-
maxValue—Specify the maximum acceptable value for the numeric field. For example, 65535.
Sample @FormField(label = "FIELD_TYPE_NUMBER", type = FormFieldDefinition.FIELD_TYPE_NUMBER, minValue = 1, maxValue = 65535) private int number;
-
-
FIELD_TYPE_TABULAR
The FIELD_TYPE_TABULAR defines a field as a table.
Attributes -
table—Specify a name for the tabular field.
-
multiline—This attribute is boolean type. Set as true to allow addition of multiple lines for the table.
Sample @FormField(label = "FIELD_TYPE_TABULAR", type = FormFieldDefinition.FIELD_TYPE_TABULAR, table = SimpleTabularProvider.SIMPLE_TABULAR_PROVIDER, multiline = true) private String[] plainTabularValues;
-
-
FIELD_TYPE_BOOLEAN
The FIELD_TYPE_BOOLEAN sets a field as boolean type. If the field is selected, the field value is set as true otherwise the field value is set as false.
Attributes
No specific attribute for this field.
Sample @FormField(label = "FIELD_TYPE_BOOLEAN", type = FormFieldDefinition.FIELD_TYPE_BOOLEAN) private boolean boolType;
-
FIELD_TYPE_LABEL
The FIELD_TYPE_LABEL argument lets you specify a label for the field.
Attributes -
htmlPopupTag—Specify the URL that need to be loaded in the popup window.
-
htmlPopupLabel—Specify the label for the popup window.
-
htmlPopupStyle—Set the popup style for the label using one of the following values:
-
INFO_TAG
-
HELP_TAG
-
CUSTOM_TAG
-
INFO_URL
-
HELP_URL
-
CUSTOM_URL
-
Sample @FormField(type = FormFieldDefinition.FIELD_TYPE_LABEL, label = "FIELD_TYPE_LABEL", htmlPopupTag = "http://www.cisco.com",htmlPopupLabel = "http://www.cisco.com", htmlPopupStyle = HtmlPopupStyles.CUSTOM_URL) private String dummyLink;
-
-
FIELD_TYPE_EMBEDDED_LOV
The FIELD_TYPE_EMBEDDED_LOV defines the field as embedded list of values (LOV) type and allows user to select one of value from the list of values.
Attributes -
You can specify either lov or lovProvider as attribute.
Sample @FormField(label = "FIELD_TYPE_EMBEDDED_LOV", help = "Value", type = FormFieldDefinition.FIELD_TYPE_EMBEDDED_LOV, lovProvider = SimpleLovProvider.SIMPLE_LOV_PROVIDER) private String value;
-
-
FIELD_TYPE_PASSWORD
The FIELD_TYPE_PASSWORD sets a field as password. The characters in a password field are masked (shown as asterisks or circles).
Attributes
No specific attribute for this field.
Sample @FormField(label = "FIELD_TYPE_PASSWORD", type = FormFieldDefinition.FIELD_TYPE_PASSWORD) private String password;
-
FIELD_TYPE_DATE
The FIELD_TYPE_DATE defines an input field that should contain a date.
Attributes
No specific attribute for this field.
Sample @FormField(label = "FIELD_TYPE_DATE", type = FormFieldDefinition.FIELD_TYPE_DATE) private long dateLong;
-
FIELD_TYPE_DATE_TIME
The FIELD_TYPE_DATE_TIME defines an input field that should contain a date and time.
Attributes
No specific attribute for this field.
Sample @FormField(label = "FIELD_TYPE_DATE_TIME", type = FormFieldDefinition.FIELD_TYPE_DATE_TIME) private long dateTime;
-
FIELD_TYPE_MULTI_SELECT_LIST
The FIELD_TYPE_MULTI_SELECT_LIST defines an input field to accept input from the multiple values.
Attributes -
lovProvider—Set the list of values that need to be displayed in the input field.
Sample @FormField(label = "FIELD_TYPE_MULTI_SELECT_LIST", type = FormFieldDefinition.FIELD_TYPE_MULTI_SELECT_LIST, lovProvider = SimpleLovProvider.SIMPLE_LOV_PROVIDER) private String listValue;
-
-
FIELD_TYPE_HTML_LABEL
The FIELD_TYPE_HTML_LABEL defines a field as HTML label. The HTML tag are accepted as string.
Attributes -
size—Set the size of the HTML label.
Sample @FormField(type = FormFieldDefinition.FIELD_TYPE_HTML_LABEL, label = "FIELD_TYPE_HTML_LABEL", htmlPopupLabel = "<a href='http://www.cisco.com'>Cisco</a>") private String dummyLink2;
-
-
FIELD_TYPE_FILE_UPLOAD
The FIELD_TYPE_FILE_UPLOAD defines a field to upload a file.
Attributes
No specific attribute for this field.
Sample @FormField(label = "FIELD_TYPE_FILE_UPLOAD", type = FormFieldDefinition.FIELD_TYPE_FILE_UPLOAD) private String uploadFileName;
-
FIELD_TYPE_TABULAR_POPUP
The FIELD_TYPE_TABULAR_POPUP defines the field as a tabular popup type.
Attributes -
table—Specify the tabular field name (TabularPovider) that has been already registered in the open automation module.
The following sample code of how the tabular provider is registered in the open automation module: StorageModule.java(Registering Tabular report) cfr.registerTabularField(SimpleTabularProvider.SIMPLE_TABULAR_PROVIDER, SimpleTabularProvider.class, "0", "0");
Sample @FormField(label = "FIELD_TYPE_TABULAR_POPUP", type = FormFieldDefinition.FIELD_TYPE_TABULAR_POPUP, table = SimpleTabularProvider.SIMPLE_TABULAR_PROVIDER) private String tabularPopup;
-
-
FIELD_TYPE_EMBEDDED_LOV_RADIO
The FIELD_TYPE_EMBEDDED_LOV_RADIO defines the field as an embedded LOV radio buttons.
Attributes -
You can choose either lov or lovProvider as attribute.
Sample @FormField(label = "FIELD_TYPE_EMBEDDED_LOV_RADIO", type = FormFieldDefinition.FIELD_TYPE_EMBEDDED_LOV_RADIO, mandatory = true, lov = { "Mode 1", "Mode 2", "Mode 3"}, validate = true, group="FIELD_TYPE_EMBEDDED_LOV_RADIO") private String modeType = "Select Mode";
-
-
FIELD_TYPE_HTML_TEXT
The FIELD_TYPE_HTML_TEXT defines the field as a HTML text type.
Attributes
No specific attribute for this field.
Sample @FormField(label = "FIELD_TYPE_HTML_TEXT", type = FormFieldDefinition.FIELD_TYPE_HTML_TEXT, editable = true, size=FormFieldDefinition.FIELD_SIZE_MEDIUM_SMALL) private String status = "<h1>FIELD_TYPE_HTML_TEXT</h1>";
-
FIELD_TYPE_LABEL_WITH_SPACE
The FIELD_TYPE_LABEL_WITH_SPACE defines the field as a label with space.
Attributes
No specific attribute for this field.
Sample @FormField(label = "FIELD_TYPE_LABEL_WITH_SPACE", help = "Ordering of VNICs", type = FormFieldDefinition.FIELD_TYPE_LABEL_WITH_SPACE) private String vnicLabel;
-
FIELD_TYPE_IMAGE_SELECT_LIST
The FIELD_TYPE_IMAGE_SELECT_LIST defines the field that should accept selection of image from the image select list.
Attributes
No specific attribute for this field.
Sample @FormField(label = "FIELD_TYPE_IMAGE_SELECT_LIST", type = FormFieldDefinition.FIELD_TYPE_IMAGE_SELECT_LIST, mandatory = false, editable = true) private String catalogIcon;
-
FIELD_TYPE_BUTTON_PANEL
The FIELD_TYPE_BUTTON_PANEL defines the field as a button panel.
Attributes -
lov—Specify the registered LOV provider name. Also, you can can directly give the values as Lov ={http,https}. For more information, refer the SimpleLovProvider.java sample LOV provider in the open automation module.
Sample @FormField(label = "FIELD_TYPE_BUTTON_PANEL", type = FormFieldDefinition.FIELD_TYPE_BUTTON_PANEL, lov = {"Discover Servers"}, validate = true, group = "UCSM/CIMC Common", mandatory = false) private String discoverServers = "Discover Servers";
-
-
FIELD_TYPE_TEXT_LINE_NUMS
The FIELD_TYPE_TEXT_LINE_NUMS defines the field as a text field with line numbers.
Attributes -
maxlength—Specify the maximum number of character allowed in the text field.
-
multiline—This attribute is boolean type. Set as true to allow addition of multiple lines for the text field.
-
size—Set the size of the text field using one of the following values: -
FIELD_SIZE_SMALL
-
FIELD_SIZE_MEDIUM
-
FIELD_SIZE_LARGE
-
FIELD_SIZE_MEDIUM_SMALL
-
FIELD_SIZE_LARGE_SMALL
-
FIELD_SIZE_SMALL_MEDIUM
-
FIELD_SIZE_LARGE_MEDIUM
-
FIELD_SIZE_SMALL_LARGE
-
FIELD_SIZE_MEDIUM_LARGE
-
Sample @FormField(label = "FIELD_TYPE_TEXT_LINE_NUMS", help = "Error Text to validate", mandatory = false, multiline = true, maxLength = 8192, type = FormFieldDefinition.FIELD_TYPE_TEXT_LINE_NUMS, size = FormFieldDefinition.FIELD_SIZE_SMALL_LARGE) private String message;
-
-
FIELD_TYPE_LARGE_FILE_UPLOAD
The FIELD_TYPE_LARGE_FILE_UPLOAD defines a field that should allow user to upload a large file.
Attributes
No specific attribute for this field.
Sample @FormField(label = "", help = "Upload a file", mandatory = true, validate = true, type = FormFieldDefinition.FIELD_TYPE_LARGE_FILE_UPLOAD, annotation = "For module uploads only zip format are supported") private String uploadFile;
-
FIELD_TYPE_COLORPICKER
The FIELD_TYPE_COLORPICKER defines a field to pick a color.
Attributes
No specific attribute for this field.
Sample @FormField(label = "FIELD_TYPE_COLORPICKER", help = "Color", mandatory = true, validate = true, type = FormFieldDefinition.FIELD_TYPE_COLORPICKER) private String color;
Common Attributes
This section provides a list of common attributes that you can use along with the form fields to control the field activity. For example, if you want to make Name field as mandatory, you need to pass true as the mandatory attribute value.
-
validate—The attribute type is boolean. By default, the attribute value is false. If you want to validate a field, you need to pass true as the attribute value.
-
hidden—The attribute type is boolean. By default, the attribute value is false. If you want to hide a field in a form, you need to pass true as the attribute value.
-
mandatory—The attribute type is boolean. By default, the attribute value is false. If you want to make a field as mandatory, you need to pass true as the attribute value.
-
editable—The attribute type is boolean. By default, the attribute value is false. This attribute is only applicable for text field. If you want to make the text field as editable, you need to pass true as the attribute value.
-
group—The attribute type is string. If you want to define single field or multiple fields in a group, you need to specify the group name as the attribute value.
-
view—The attribute type is string. If you have multiple forms in a wizard, you need to mention the page number as the attribute value so that the field will be displayed on the specified page number. If you do not have multiple pages in a wizard, no need to use this attribute.
-
help—The attribute type is string. This attribute lets you specify descriptive help text for the field. If you provide help text, the text will be displayed when a user hovers the mouse pointer over the field.