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. MT_Portrait | true() | false() | MT_Landscape | true() | false() |
|
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. MT_CanvasX | Width, as a length value in pixels | MT_CanvasY | Height, as a length value in pixels |
If you enter pixel values for properties that define lengths, then, when rendering for iOS devices, these values are read as points in the viewport coordinate space. The viewport coordinate space is the canvas on which the design components are drawn, and a point is the length unit in this space; a point here is not the typographical unit that is equal to 1/72 of an inch. The iOS device automatically maps the points of the viewport coordinate space to pixels in the device coordinate space. Mapping the values in this way (from viewport values to device values) ensures that design components maintain the same size relationship to both the canvas and to each other, no matter what the resolution of the iOS device is or what units are used. In MobileTogether Designer, you can use the $MT_CanvasX and $MT_CanvasY dynamic variables to find out the current viewport (canvas) dimensions and so obtain lengths that are relative to these dimensions. (For iOS devices, the values returned by these variables are calculated as follows: The pixel dimensions of the current device coordinate space are converted (using an appropriate conversion factor) to point values in the viewport coordinate space. These point values—as numbers—are returned by the variables as pixels for use in the design.) For example, if you want an image to be half the width of the viewport, then give it a width in pixels that is equal to $MT_CanvasX * 0.5; the XPath expression for this image width would be concat($MT_CanvasX * 0.5, 'px'). |
|
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). MT_WindowHeight | A length value in pixels | MT_WindowWidth | A length value in pixels |
|
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'. MT_ControlKind | The kind of control, as a string. Example: "Label" | MT_ControlName | The name you give the control, as string. Example: "Label-1" | MT_ControlNode | XML node that is the control's source node | MT_ControlValue | Value of the control's page-source-link node | MT_ControlValueBeforeChange | Previous value of the control's page-source-link node, before the control or node is edited |
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. |
This variable is usable only in actions that are defined for Audio playback events. It holds an integer that is the number of the audio channel (1 to 5) that triggered the event. |
If a solution is subscribed to a broadcast topic and receives messages, then the latest received message is stored in this variable. The message can then be accessed via this variable, typically in the page event OnBroadcastReceived or the project event OnBroadcastReceived. |
The XML result of the last executed DB Execute action. Note that any kind of SQL statement can be used in the DB Execute action. So executing the action could obtain various kinds of result XML data, including, for example, data from the DB, boolean values, or computational results. |
Contains the context node of the source node to be dropped. This is the the row group of the context node. See Table Properties for information. |
Contains the context node of the target, which is the row group in which the source is to be dropped. See Table Properties for information. |
Set to true() if this is the first time the page is loaded during the current workflow execution. |
The dynamic variable $MT_GeolocationMapMarker contains information about the marker that was last clicked by the client's user. This information that is contained in the variable is stored in an XPath-map construct, in a format that is shown by the following example: map { "id":"vie", "geolocation":(48.2143531, 16.3707266), "title":"Vienna", "text":"Altova EU" } To fetch a value from the XPath-map construct, use an XPath expression like this: map:get( $MT_GeolocationMapMarker, "id" ). This particular expression returns the value of the id key (that is, the id of the marker that was clicked). |
This variable is a sequence of strings that contains the action stack that triggered the OnServerConnectionError event. Since action names can change from release to release, this variable should be used only for debugging. |
This variable contains the context node of the current column when a table with dynamic columns is being generated. It is indispensable when working with tables that contain both dynamic rows as well as dynamic columns. In such tables, cell content is defined in the context of the element that is associated with the dynamic row. Within this row context, the MT_TableColumnContext variable can be used to locate the element that is associated with the current column. For an example of how to use the variable, see the section Tables | Dynamic Columns. |
The email address to which messages from MobileTogether Server will be sent. These messages from the server typically relate to administrative events and tasks on the server, and the email address of the recipient of these messages is typically specified in the MobileTogether Server settings. The MT_UserMail variable, however, enables you to specify the email address via the design. |
The roles of the currently logged in user. The roles are those that are assigned to the user by the MobileTogether Server administrator, and are obtained from MobileTogether Server. |
|