Dynamic Local Variables
Dynamic-value variables are called Local Variables in the Global Variables dialog. They contain device-related and project-related information that can change during project execution. For example, the device orientation variables will change according to how the end user is currently holding the device (see the description of the device orientation variables below).
The variables that contain information about the current control (see below) are particularly useful because they can be used to refer to different aspects of the control and the node being currently processed. Being able to identify the current control and node enables conditional processing. For example, the \$MT_ControlNode variable can be used to test which node is the current node at a given time during project execution, and locate another node on this basis. The \$MT_ControlValue variable holds the content of the node associated with the current control.
Note: | Please see the Global Variables dialog for a complete list of variables and their descriptions. |
DescriptionThe values of MT_Portrait and MT_Landscape can be true() or false()and can change during the course of project execution. They can be used to specify page or control properties according to device orientation.
|
DescriptionThese variables provide, respectively, the width (X dimension) and height (Y dimension) of the device's viewport. Note that the value of the X dimension changes with the orientation (portrait/landscape), as does the Y dimension. The viewport is the screen area on which design components are drawn; it is the screen area minus the top and/or bottom bars that hold tabs/buttons. In web-browser clients, the \$MT_CanvasX and \$MT_CanvasY variables give the dimensions of the canvas on which the MobileTogether Client app is displayed (that is, the dimensions of the browser window minus the title bar, ribbon, status bar, and any sidebars). The values of these variables are pixel values and will necessarily be less than the device's height and width dimensions (returned respectively by MT_DeviceHeight and MT_DeviceWidth). See the note Points Versus Pixels on iOS devices below.
|
DescriptionThese variables are applicable only for for web browsers and Windows app devices. Browser windows, as well as app windows on Windows RT devices and touch-enabled Windows operating systems, can be re-sized by the user (just like windows in desktop apps can be re-sized). The \$MT_WindowHeight and \$MT_WindowWidth variables hold the height and width, respectively, of the window in which the MobileTogether Client app is running. In browsers, these variables give the height and width of the browser window. (In browsers, the canvas on which the MobileTogether Client app is displayed (that is, the dimensions of the browser window minus the title bar, ribbon, status bar, and any sidebars) is given by the \$MT_CanvasX and \$MT_CanvasY variables).
|
DescriptionThese variables contain information related to the current control and its associated page source node (the source node of the control). The values of these variables change during execution according to which control is being currently processed. For example, the \$MT_ControlNode variable has different values as the associated node changes as the current control changes. (Note that some controls, such as the space and horizontal line controls, do not have page source links, while others, like the chart control, will not have an XML value as the content of its associated node.)
The \$MT_ControlNode variable is a pointer to the source tree node. So you can use it for tests such as this: \$MT_ControlNode/localname()="first".
These variables are useful for changing a control's properties based on the control's values. For example, a \$MT_ControlValue variable can be used to change a label's background color to red in case an error is encountered: if (\$MT_ControlValue = 'NaN') then '#FF0000' else '#FFFFFF'.
Note: The \$MT_ControlValue variable is not available for the generation of the values of the Visible, Get Value From XPath, and Text properties of controls. If used for the values of these properties, then a validation error results.
|
|