UI Element - RadioButtonGroup
Related subfolder of the training project: "Training/UIM/Exercise/Basic"
Chapter Overview
In this training chapter you get familiar with the configuration possibilities of the UI Element RadioButtonGroup.

TAB "Element Properties"
The TAB "Element Properties" contains the configuration for
-
UI container horizontal alignment (left, center, right)
-
label position (text before, text after)
-
v-orientation (horizontal, vertical)

TAB "Data Mapping"
The TAB "Data Mapping" contains the attribute type related mapping of the UI element
-
enum

TAB "Data Validation"
The TAB "Data Validation" contains the attribute type related validation, default value and mandatory specification of the UI element based on the BO attribute configuration in SubTAB "Values and Validation".
-
default value
-
mandatory
TAB "Events"The TAB "Events" contains the events and related "Action" and "Validation" scripts of the UI element. -
onClick
-
onDoubleClickFor each UI element the related event action is displayed at the right side of the UI element. In case of a validation error a default error message is displayed at the top right of the UI page and the action script is not executed.
TAB "Visibility"The TAB "Visibility" contains the visibility configuration and the "Visibility" scripts of the UI element. -
editable/read-only
-
visible/invisibleFor each UI element the visibility can be changed by the checkbox "Visibility Toggle".

Exercise
In this exercise you will get familiar with the configuration possibilities of the UI element by completing the UI TABs as described above. You can test the implementation in UI Page Preview, in the Preview of the Frontend Service Model and optionally in the xAPPnow User Portal.
Exercise 1: Create UI Page "RadioButtonGroup"
-
Step 1: Open context menu of folder "Automation/User Interface/Training/UIM/Exercise/Basic" in the model tree
-
Step 2: Select menu function "Create Model" to open dialog "Create User Interface Model"
-
Step 3: Enter model name "RadioButtonGroup" and keep option "Model Type: UI Page"
-
Step 4: Select option "From: UI Page" to open dialog "Select UI Page", open folder "…/Training/UIM/Template/Basic" to select template "TMPL_RadioButtonGroup" with double click then keep default option for "Default Device" and "Default Label" then click button "OK" to create the UI page

Exercise 2: TAB "Element Properties"
-
Step 1: Drag&Drop attribute "color" from TAB "Data" into second free span to open dialog "Select Component", select "RadioButtonGroup" on list, keep the checkbox "Create Label" selected to add the corresponding UI Label and UI RadioButtonGroup to the UI page and click button "OK".

-
Step 2: Repeat Step 2 and add Label and RadioButtonGroup for attribute "color" to
-
Container H-Aligment [Center], [Right]
-
Label Position [Text Before], [Text After]
-
V-Orientation [Checked], [Unchecked]
-
Step 3: Open TAB "Implementation" SubTab "Element Properties" and select each RadioButtonGroup. Click at button "Span" to configure the value H-Alignment [Left], [Center], [Right]
-
Step 4: In next row select the first UI RadioButtonGroup to configure label position text before [checked]
-
Step 5: In next row select the first UI RadioButtonGroup to configure "V-Orientation" [checked]
Exercise 3: TAB "Data Mapping"
-
Step 1: Drag&Drop attribute "person.gender" from TAB "Data" into second span to open dialog "Select Component" to add the corresponding UI Label and UI RadioButtonGroup to the UI page.
-
Step 2: Select UI RadioButtonGroup and open TAB "Implementation", SubTAB "Element Properties" and check property "V-Orientation"

Exercise 4: TAB "Data Validation"
-
Step 1: Drag&Drop attribute "academicLevel" from TAB "Data" into the third free span to open dialog "Select Component" to add the corresponding UI Label and UI RadioButtonGroup to the UI page.
-
Step 2: Open TAB "Implementation", SubTAB "Element Properties" and check V-Orientation property
-
Step 3: Repeat Step 1 and Step 2 and add Label and RadioButtonGroup for attribute
-
"maritalStatus"
Exercise 5: TAB "Events" - Action Scripts
-
Step 1: Drag&Drop attribute "employment" from TAB "Data" into second free span and keep default in dialog "Select Component" to add the corresponding UI Label and UI RadioButtonGroup to the UI page.
-
Step 2: Repeat Step 1 to add Label and RadioButtonGroup for attributes
-
"musicalGenre"
-
Step 3: Select the first UI RadioButtonGroup and open TAB "Implementation" SubTab "Events" to specify event type "onClick"
-
Step 4: Implement the action script, which displays the event action at the right side of the UI element.
localData.eventType.onClick = globalDef.enums.Tutorial.UIM.DEF.EventMessage.ON_CLICK;
-
Step 5: Repeat Step 3 and 4 for the other UI elements to specify further event types and related action scripts, which display the related event action at the right side of the UI element.
-
event type "onDoubleClick"
localData.eventType.onDoubleClick = globalDef.enums.Tutorial.UIM.DEF.EventMessage.ON_DOUBLE_CLICK;
Exercise 6: TAB "Events" - Action & Validation Scripts
-
Step 1: Select the first UI RadioButtonGroup and open TAB "Implementation" SubTab "Events" to specify event type "onClick"
-
Step 2: Implement the action the validation scripts, which display the related event action at the right side of the UI element in case of no validation error.
-
action script "onClick" event
localData.eventType.onClickValid = globalDef.enums.Tutorial.UIM.DEF.EventMessage.ON_CLICK_VALID;
-
validation script "onClick" event
localData.eventType.isValid
-
Step 3: Repeat Step 1 and 2 for the other UI elements to specify further event types and related event action and validation scripts, which display the related event action at the right side of the UI element.
-
action script
-
event type "onDoubleClick"
localData.eventType.onDoubleClickValid = globalDef.enums.Tutorial.UIM.DEF.EventMessage.ON_DOUBLE_CLICK_VALID;
-
validation script "onDoubleClick" event
localData.eventType.isValid
Exercise 7: TAB "Visibility"
-
Step 1: Drag&Drop attribute "toggleVisibility" from TAB "Data" into the third free span and keep default in dialog "Select Component" to add the corresponding UI Label and UI CheckBox to the UI page.
-
Step 2: Select the first RadioButtonGroup and open TAB "Implementation" SubTab "Visibility"
-
Step 3: Click at visibility type "Editable" and select state "Script"
-
Step 4: Implement the visibility script, which toggles the visibility "editable" and "read-only"
localData.toggleVisibility
-
Step 5: Repeat steps 2..4 for second UI RadioButtonGroup for visibility type "Visible", which toggles the visibility "visible" and "invisible"
Exercise 8: Link UI Page to Frontend Service Model
-
Step 1: Open frontend service model "Automation/Service/Training/UIM/Exercise/Basic/RadioButtonGroup"
-
Step 2: Select UI page "View Radio ButtonGroup" to open TAB "General", SubTAB "Element"
-
Step 3: Click button “Search“ to open dialog "Select or Create Submodel" and select UI page "RadioButtonGroup" with double click

-
Step 4: Right click on button flow to select button "Exit".

Exercise 9: Test the UI Page
-
Step 1: Open UI Page and click button "Preview" in the toolbar to directly test the UI page within the UI editor
-
Step 2: Optionally publish the frontend service model and test the UI page in User Portal






















