Switch

This post is referring to Vahana 2 (beta version). To check the document for production, please go to vDesigner-v1.0

Definition

A switch is used to quickly switch between two possible states. It is commonly used for “on/off” states.

Usage

When to use
If you need to represent the switching between two states or on-off states.

Switch Configuration

For the “Switch” element, you can configure the following UI properties:

  • UI Configuration
  • Event Configuration

UI Configuration

TabProperty NameDescriptionMandatoryNew Default ValueVisibility Rules
BasicReference NameSpecifies a unique name of the element. At the application level, an element is identified and managed by the reference name.YesSwitch 1
BasicCaptionSpecifies the title of the element.NoSwitch
BasicDefault ValueThis property allows you to define the default value of an element.

To define the default value:
–> Click in this box, and it displays the list of the pre-define functions, attributes, and element IDs.
–> In the list, select an attribute from which the application will fetch the default value and then display it in the element.
BasicVisibleAllows you to define the default visibility of the UI element. Nomarked
BasicEnableAllows the user to enable/disable an element. You can decide whether the element needs to be clickable and usable.Nomarked
BasicMandatoryAllows you to configure the element as a mandatory element.Nounmarked
BasicMessage on FailureThis property becomes visible when you select Yes under Mandatory. In the Message on Failure box, enter the error message that the application will display if the user does not perform the function on the element. NoRequiredwhen mandatory = checked
UI PropertiesStylesAllows you to select a specific style for the element from the list of pre-defined styles. The vDesigner module offers pre-defined styles that you can apply to the element. These pre-defined styles are:
–> Primary
–> Secondary
NoPrimary
UI Properties-
Alignment & Spacing
MarginAllows you to desirably define margin around each side of the element. It provides four different boxes to define the margin outside the right, left, top, and bottom border of the element.NoTheme Variable (Margin)
UI Properties-
Alignment & Spacing
Element AlignmentClick this list to align the element as follows:
–> Right
–> Top
–> Bottom
–> Top Right
–> Top Left
–> Bottom Right
–> Bottom Left
–> Center
NoLeft Top
UI Properties- CaptionFontSelect the font type (For example: – Arial) of the element’s caption.NoTheme Variable (Font Family)
UI Properties- CaptionSizeEnter the font size of the caption.No12
UI Properties- CaptionColorSelect the color of the font of the caption.NoTheme Variable (Caption)
UI Properties- CaptionBoldEnter the thickness of the character of the element’s caption in the range of values from 1 to 9.No4
UI Properties- CaptionStyleSelect the style of font (For example:- Italic) of the captionNoNormal
UI Properties- Shape & DecorationXAllows you to move the element along the X-axis; when the value increases, the element moves from left to right.NoShow and Disable
UI Properties- Shape & DecorationYAllows you to move the element along the Y-axis; when the value increases, the element moves from top to bottom.NoShow and Disable
UI Properties-
Select
ColorClick the Color box and then define the color of the switch when the user selects it to perform the function.No#FFFFFFF
UI Properties-
Select
OpacityOpacity is the degree to which content behind an element is hidden, and is the opposite of transparency.

While configuring the color, you can also configure the opacity in the percentage unit.
Yes100%
UI Properties-
Select
Border ColorAllows you define the color of the element’s border. To define the color:
–> In the Border Color box, click the left color box (), a color canvas open.
–> On the canvas, on the horizontal bar, move the circle to select the color.
–> In the upper section, move the circle to select the tone of the color.
Yes#e0e0e0
UI Properties-SelectThumb ColorClick the Color box and then define the color of the thumb when the user selects and moves it to switch between two states.NoTheme Variable (Primary)
UI Properties-SelectOpacityOpacity is the degree to which content behind an element is hidden, and is the opposite of transparency.

While configuring the color, you can also configure the opacity in the percentage unit.
Yes100%
UI Properties-UnselectColorClick the Color box and then define the color of the switch when the user does not select it to perform the function.No#FFFFFFF
UI Properties-UnselectOpacityOpacity is the degree to which content behind an element is hidden, and is the opposite of transparency.

While configuring the color, you can also configure the opacity in the percentage unit.
Yes100%
UI Properties-UnselectThumb ColorClick the Color box and then define the color of the thumb when the user does not select the “Switch” element to switch between two states.No#FFFFFFF
UI Properties-UnselectOpacityOpacity is the degree to which content behind an element is hidden, and is the opposite of transparency.

While configuring the color, you can also configure the opacity in the percentage unit.
Yes100%
DataEntity PathThis property allows you to map an attribute to the element. You define the JSON based attributes in the entity in the Data Modeler module.

To define the entity path:
–> Click in the Entity Path box, and a list expands.
–> The list displays several attributes from the entity.
–> In the list, select an attribute to map it to the element.

After the user performs the function on the element, the application can perform the following functions:
a. Fetches data from the attribute and then displays it in the element.
b. Stores data in the attribute.
NoEntityName.

Event Configuration

On the “Switch” element, you can configure the following event:

  • onSelect
Was this article helpful?
YesNo