Developer Home
MAX Overview
API Reference
Download
|
MAX Variable Reference
| Object |
Full variable name |
Description |
| request |
|
|
|
{request.[param]} |
the value of the parameter named [param] in the current url |
| query |
|
|
|
|
{[queryid].[field]} |
the value of the field named [field] for the current record of the
query identified by its id attribute [queryid] |
|
|
{[queryid].count} |
the number of records in the query identified by
its id attribute [queryid] |
|
|
{query.lastrowid} |
the primary key value of the last inserted record in a local datastore, after a call
to query.execute() script function |
|
item |
|
|
|
|
{this.text}, {selection.text} or {[itemid].text} |
the text content of the current or selected <item> element |
|
|
{this.id}, {selection.id} or {[itemid].id} |
the value of the id attribute of the current or selected <item>
element |
|
|
{this.icon}, {selection.icon} or {[itemid].icon} |
the value of the icon attribute of the current or selected
<item> element |
|
page |
|
|
|
|
{page.title} |
the title of the current <page> |
|
|
{page.id} |
the id of the current <page> |
|
{page.url} |
the url of the curret <page> |
|
{page.selectedlink} |
the href value of the currently selected hyperlink in the
<textarea> element of the current <page> |
| device |
|
|
|
|
{device.now} |
the current date and time as a long integer (in Epoch format, number of milliseconds
since Jan 1st, 1970) |
|
{device.version} |
the version of the Upvise client currently installed on the phone |
How variables work and where can I use them?
Variables are always enclosed inside brackets {}. You can use variables anywhere
in the attributes and text content of any XML element of the MAX language except
in the following cases
When are variables resolved?
are evaluated during page load
and replaced by their value, before the page is displayed on the phone screen. Exceptions
are {this.xxx} and {selection.xxx} and {document.selectedlink}
varaibles, found inside a onclick attribute of an <item>
or <textarea> element, which are resolved
only when the script is executed.
Variable Operators
A limited but useful set of operators can be used inside brackets:
- equality operator a == b
- superior operator a> b
- conditional operator a ? b : c
These operators can use any above variable as parameter and also literals such a
number and string to be put inside single quotes.
Variable Modifiers
A variable is always in the format objectname.variablename. You
can add an optional suffix modifier after the variable name in the following
syntax: objectname.variablename.modifier
. These Modifiers are used to modify the value of
the variable value.
The valid modifiers are :
- lowercase : puts the variable value to lower case. Requires that
the type of the variable is a string.
- formatdate : transform the long integer value of the varaible to
a formated string containing the short date in the format DD,MM,YY
|