Dynamic Variables

In order to use variables to store values that all your <widget>s can utilize, your variables must be declared in the opening <dynamic> tag of the <dynamic> element that contains the QuickApp.

A QuickApp is effectively a collection of <widget> elements and <layout> elements contained within a <dynamic> element. These elements work together to create a cohesive and useful experience for end-users who consume the QuickApp. For the QuickApp author, it is often necessary to modify a value with one <widget> and display the results in another. To do this, variables must be used.

In order to use variables to store values that all your <widget>s can utilize, your variables must be "visible" to all the <widget>s that need to use them. To accomplish this, all variables must be declared in the opening <dynamic> tag of the <dynamic> element that contains the QuickApp. Variables in the <dynamic> tag are declared much in the same way as they are in <block> statements. In other words, they appear in the opening <dynamic> tag as user-defined attributes, and then are referenced with a specific syntax. Here is the syntax for declaring variables in a <dynamic> tag:

<dynamic mode_="auto" var1="" var2="" var3="">
        [WIDGET]
</dynamic>

To reference a variable in a <widget>, the following syntax is used:

<dynamic mode_="auto" var1="" var2="" var3="">
       <widget class_="checkbox" value_="@var1"/>
</dynamic>

Keep in mind that a <widget> can also have user-defined variables. However, in order for all widgets to see a variable, it must be declared in the <dynamic> opening tag.