One Of
Last updated
Last updated
Prepare an application switching content based on the One Of component.
In our case, the Options Dropdown menu will contain two parameters Items that selected Value will be checked by the One Of component.
The Principle of how to use the One Of component.
Let's prepare a basic Layout containing the Option Dropdown menu and One Of component.
Place in MainView
a new Container and set up its ID -> container1
; Item Flex -> Stretch
Into the container1
place a Options, name it dropdown
and add two Items:
#1 -> Value -> "first
"
#2 -> Value -> "second
"
Then placed a One Of component with ID -> oneOf1
; Item Flex -> Stretch
; and add two Options:
#1 -> Option -> Name -> "First option
"
#2 -> Option -> Name -> "Second option
"
Switching the Clog by oneOf1
input to each of the two Texts components:
First option -> add a Text, name its Value -> "FIRST
"; Text Alignment -> Middle
; Text Style -> Bold
; Font Size -> Large
Second option -> add a Text, name its Value -> "SECOND
"; Text Alignment -> Middle
; Text Style -> Bold
; Font Size -> Large
Comparing the dropdown
Value of oneOf1
Options Conditions will trigger the display of different Content Layouts.
Switch the oneOf1
Conditions to dynamic Functions and set up as follows:
First option -> Condition -> dropdown.value == "first"
Second option -> Condition -> dropdown.value == "second"
Don't forget that any Current Values of any existing components are visible in the Data Explorer.
The One Of component is an effective tool how to switch between content. Try to add more Option Layouts and change them by a different component method.
Follow up on our One Of tutorial https://youtu.be/ywBr11REwrQ