Binding Visibility To Tags
The standard way to control visibility of Web Page elements is to create tags and use the Visible property of the elements.
For example, on a Web Page, there is a Data Inputs On/Off CheckBox and a collection of Numeric Entry elements that are used to adjust values.
The Numeric Entry elements should disappear when the CheckBox is unchecked.
- Add a CheckBox and Numeric Entry elements that you want to hide.
-
In the Tag Manager, create a tag called hidden.controls; it should be Boolean type, set to True by default (in this example True makes the element visible).
-
Select a Numeric Entry element and bind its Visible property to hidden.controls.
-
Click the
next to Visible.
-
In the Expression Builder, bind the property to $hidden.controls and then click OK.
-
The
icon indicates that the Visible property is now bound to $hidden.controls.
-
-
Select your CheckBox and select On Changed from the Properties.
-
In the CheckBox.change script, enter the following: $hidden.controls = !$hidden.controls;
-
To test that it works, put your project in deployed mode, and uncheck the CheckBox; the Numeric Entry elements should disappear when unchecked.