SelectionBoxAttribute class
Input attribute of selection dropdown type.
Package
com.sybase365.mobiliser.brand.plugins.smapp.controls
Base class
Members
All members of SelectionBoxAttribute, including inherited members.
Constructors| Modifier and Type | Constructor | Description |
|---|---|---|
| public | SelectionBoxAttribute(String, String, boolean) | Constructor. |
| Modifier and Type | Method | Description |
|---|---|---|
| public InputValue | getInputValue() | More efficient way to check and obtain the value of the input attribute using a single database call. |
| public List< KeyValuePair< String, String > > | getItems() | List of items that will be used for the dropdown list. |
| public String | getItemValue(String) | Helper method to find the value of the specified key from the dropdown list. |
| protected String | getRawValueLog() | |
| public boolean | isSet() | Return True/False when the InputAttribute contains value or not, respectively. |
| public void | setItems(List< KeyValuePair< String, String >>) | Set the list of items to be used in populating the dropdown list. |
| Modifier and Type | Member | Description |
|---|---|---|
| public InputType | getInputType() | Input type can be changed from the State Editor by checking/unchecking the input attribute checkbox, to set to InputType#SESSION or InputType#ATTRIBUTE, respectively. |
| public InputValue | getInputValueWithWarning() | Similar to getInputValue() but this method throws RequiredParameterMissingException when the input attribute is not optional (or mandatory) but the value is null (or not populated). |
| protected String | getRawValue() | Helper class used internally by the getInputValue(), getInputValueWithWarning(), and getValue(). |
| public InputValue | getValue() | Get the InputValue with no warning. |
| public | InputAttribute(String, String, boolean) | Constructor. |
| public boolean | isCheckboxEnabled() | Whether the UI checkbox component is enabled or not. |
| public boolean | isOptional() | Whether the input attribute is optional. |
| public void | setCheckboxEnabled(boolean) | Enable or disable the checkbox. |
| public void | setInputType(InputType) | Input type can be changed from the State Editor by checking/unchecking the input attribute checkbox, to set it to InputType#SESSION or InputType#ATTRIBUTE, respectively. |
| public void | setOptional(boolean) | Set the input attribute optional status. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | Attribute(String, String) | Default value (if provided) |
| protected SmappStateProcessingContext | getContext() | Sets the processing engine context. |
| public String | getDescription() | Detailed description of the attribute. |
| public String | getId() | Attribute Id. |
| public String | getText() | The text that was entered in the input field on the state editor. |
| public void | setContext(SmappStateProcessingContext) | Sets the processing engine context. |
| public void | setDescription(String) | Detailed description of the attribute. |
| public void | setId(String) | Attribute Id. |
Usage
The State Editor will display this input attribute using a selection dropdown component with preset list. User can select a value from the dropdown list but not entering a new one.
By default, the SelectionBoxAttribute has a InputAttribute.InputType#ATTRIBUTE type, so the input attribute checkbox will be unchecked, and it means the value is static and will be used as is. The choice made by the user on the State Editor will be treated as a static value, and used as is. The dropdown is populated with a "Key-Value" list, and the selected value is the "Key". The "Value" is the displayed text shown on the UI.
This SelectionBoxAttribute can also be set to InputAttribute.InputType#SESSION type, to retrieve the value from the session variable. The name of the session variable will be the ID of this selectionbox attribute, and it cannot be changed. On the state editor, the ID will be shown on mouse-hover over the input attribute description. When set to the InputAttribute.InputType#SESSION type, the selection should be left null.