xAPPnow LOW CODE PLATFORM - User Manual 

Still no account yet?

×

UI Element - Switch

 
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 Switch.
 
 
 
TAB "Element Properties"
 
The TAB "Element Properties" contains the configuration for
 
  • UI container horizontal alignment (left, center, right)
     
 
 
 
 
 
 
TAB "Data Mapping"
 
The TAB "Data Mapping" contains the attribute type related mapping of the UI element
 
  • bool
     
 
 
 
 
 
 
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".
 
  • bool default value true
     
     
     
     
     
     
    TAB "Events"
     
    The TAB "Events" contains the events and related "Action" and "Validation" scripts of the UI element.
     
  • onClick
  • onBlur
     
    For 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 the visibility configuration and the "Visibility" scripts of the UI element.
     
  • enabled/disabled
  • visible/invisible
     
    For 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 "Switch"
 
  • 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 "Switch" 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_Switch" with double click then keep default option for "Default Device" and click button "OK" to create the UI page
     
     
 
 
 
Exercise 2: TAB "Element Properties"
 
  • Step 1: Drag&Drop attribute "alignmentProperties.boolLeft" from TAB "Data" into second free span to open dialog "Select Component" and select "Switch" to add the corresponding UI Switch to the UI page.
     
     
 
 
 
UI Element - Switch
 
 
  • Step 2: Repeat Step 1 and add Switch for attributes
  •  "alignmentProperties.boolCenter"
  •  "alignmentProperties.boolRight"
     
 
 
UI Element - Switch
 
 
 
  • Step 3: Select each UI Switch and click at button "Span" to configure H-Alignment [Center], [Right] of the UI element
 
 
 
UI Element - Switch
 
 
 
Exercise 3: TAB "Data Mapping"
 
  • Step 1: Drag&Drop attribute "person.hasWork" from TAB "Data" into first free span to open dialog "Select Component" to add the corresponding UI Switch to the UI page.
 
 
 
UI Element - Switch
 
 
 
 
Exercise 4: TAB "Data Validation"
 
  • Step 1: Drag&Drop attribute "license.isAccepted" from TAB "Data" into the first free span of second row to open dialog "Select Component" to add the corresponding UI Switch to the UI page.
     
 
 
UI Element - Switch
 
 
 
  • Step 2: Repeat Step 1 and add Switch for attribute
  •  "license.isChanged"
 
 
UI Element - Switch
 
 
Exercise 5: TAB "Events" - Action Scripts
 
  • Step 1: Drag&Drop attribute "product.hasQuality" from TAB "Data" into second free span to open dialog "Select Component" to add the corresponding UI Switch
     
 
 
 
UI Element - Switch
 
 
 
  • Step 2 Repeat Step 1 to add UI Switch for attribute
  • "product.hasAcceptablePrice"
     
 
 
 
UI Element - Switch
 
 
 
  • Step 3: Select the first UI Switch and open TAB "Implementation" SubTab "Events" to specify event type "onClick"
  • Step 4: Implement the action script, which displays the action at the right side of the UI element.
 
localData.eventType.onClick = globalDef.enums.Tutorial.UIM.DEF.EventMessage.ON_CLICK;
 
                       
 
 
UI Element - Switch
 
 
 
 
  • Step 5: Repeat Step 3 and 4 for the other UI elements to specify further event types and related event action scripts, which display the action at the right side of the UI element.
     
  • event type "onBlur"
localData.eventType.onBlur = globalDef.enums.Tutorial.UIM.DEF.EventMessage.ON_BLUR;
 
 
 
 
UI Element - Switch
 
 
Exercise 6: TAB "Events" - Action & Validation Scripts
 
  • Step 1: Select the first UI Switch 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
 
 
UI Element - Switch
 
 
 
  • Step 3: Repeat Step 1 and 2 for the other UI elements to specify further event types and related action and validation scripts, which display the related event action at the right side of the UI element.
     
  • action script
 
  • "onBlur" event
localData.eventType.onBlurValid = globalDef.enums.Tutorial.UIM.DEF.EventMessage.ON_BLUR_VALID;
 
 
 
  • validation script
 
  • "onBlur" event
localData.eventType.isValid
 
 
 
UI Element - Switch
 
 
 
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.
 
 
UI Element - Switch
 
 
 
  • Step 2: Select the first UI Switch and open TAB "Implementation" SubTab "Visibility"
  • Step 3: Click at visibility type "Enabled" and select state "Script"
  • Step 4: Implement the visibility script, which toggles the visibility "enabled" and "disabled"
 
localData.toggleVisibility
 
 
UI Element - Switch
 
 
  • Step 5: Repeat steps 2..4 for second UI Switch for visibility type "Visible", which toggles the visibility "visible" and "invisible"
 
 
 
UI Element - Switch
 
 
 
Exercise 8: Link UI Page to Frontend Service Model
 
  • Step 1: Open frontend service model  "Automation/Service/Training/UIM/Exercise/Basic/Switch"
  • Step 2: Select UI page "View Switch" to open TAB "General", SubTAB "Element"
  • Step 3: Click button “Search“ to open dialog "Select or Create Submodel" and select UI page "Switch" with double click
     
     
    UI Element - Switch
     
     
     
  • 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
 
 
 
1

Drag&Drop Attribute from TAB "Data"

1. Drag&Drop Attribute from TAB "Data"
Drag&Drop attribute "alignment.boolLeft" from TAB "Data" into first free span to open dialog "Select Component" to add the corresponding UI Label and UI CheckBox to the UI page.
1

Drag&Drop Attribute from TAB "Data"

1. Drag&Drop Attribute from TAB "Data"
Drag&Drop attributes of BO "alignment" from TAB "Data" into free spans to open dialog "Select Component" to add the corresponding UI Label and UI Switch to the UI page.
 
 
 
1

Select Button "Span"

1. Select Button "Span"
Select each UI Switch and click at button "Span" to configure H-Alignment [Left], [Center], [Right] of the UI element
2

Configure H-Alignment

2. Configure H-Alignment
Select each UI Switch and click at button "Span" to configure H-Alignment [Left], [Center], [Right] of the UI element
 
 
1

Drag&Drop Attribute from TAB "Data"

1. Drag&Drop Attribute from TAB "Data"
Drag&Drop attribute "person.hasWork" from TAB "Data" into first free span and to open dialog "Select Component" to add the corresponding UI Switch to the UI page.
 
 
1

Drag&Drop Attribute from TAB "Data"

1. Drag&Drop Attribute from TAB "Data"
Drag&Drop attribute "license.isAccepted" from TAB "Data" into the first free span of second row to open dialog "Select Component" to add the corresponding UI Switch to the UI page.
1

Drag&Drop Attribute from TAB "Data"

1. Drag&Drop Attribute from TAB "Data"
Drag&Drop attribute "license.isChanged" from TAB "Data" into the first free span of second row to open dialog "Select Component" to add the corresponding UI Switch to the UI page.
 
 
1

Drag&Drop Attribute from TAB "Data"

1. Drag&Drop Attribute from TAB "Data"
Drag&Drop attribute "product.hasQuality" from TAB "Data" into second free span to open dialog "Select Component" to add the corresponding UI Switch
1

Drag&Drop Attribute from TAB "Data"

1. Drag&Drop Attribute from TAB "Data"
Drag&Drop attribute "product.hasAcceptablePrice" from TAB "Data" into second free span to open dialog "Select Component" to add the corresponding UI Switch
 
 
1

Select UI Element

1. Select UI Element
Select UI element and open TAB "Events"
2

Select Event Type

2. Select Event Type
Select event type "onClick"
3

Enter Action Script

3. Enter Action Script
Enter action script for the selected event type
 
 
1

Select UI Element

1. Select UI Element
Select UI element and open TAB "Events"
2

Select Event Type

2. Select Event Type
Select event type "onBlur"
3

Enter Action Script

3. Enter Action Script
Enter action script for the selected event type
4

Event Action

4. Event Action
The event action will display at the right side of the element.
 
 
1

Select UI Element

1. Select UI Element
Select UI element and open TAB "Events"
2

Select Event Type

2. Select Event Type
Select event type "onClick"
3

Enter Action & Validation Script

3. Enter Action & Validation Script
Enter action & validation script for the selected event type
4

Event Action

4. Event Action
The event action will display at the right side of the element.
 
1

Select UI Element

1. Select UI Element
Select UI element and open TAB "Events"
2

Select Event Type

2. Select Event Type
Select event type "onBlur"
3

Enter Action & Validation Script

3. Enter Action & Validation Script
Enter action & validation script for the selected event type
1

Drag&Drop Attribute from TAB "Data"

1. Drag&Drop Attribute from TAB "Data"
Drag&Drop attribute "toggleVisibility" from TAB "Data" into third free span and keep default in dialog "Select Component" to add the corresponding UI Label and UI CheckBox to the UI page.
1

Select UI Element

1. Select UI Element
Select UI element and open TAB "Visibility"
2

Select "Enabled" and State "Script"

 
Click at visibility "Enabled" and select state "Script"
3

Enter Visibility Script

3. Enter Visibility Script
Implement the visibility script, which toggles the visibility "enabled" and "disabled"
 
1

Select UI Element

1. Select UI Element
Select UI element and open TAB "Visibility"
2

Select "Visible" and State "Script"

2. Select "Visible" and State "Script"
Click at visibility "Visible" and select state "Script"
3

Enter Visibility Script

3. Enter Visibility Script
Implement the visibility script, which toggles the visibility "visible" and "invisible"