|
Note : the XML Schema (What is a XML Schema?) for the MAX XML Language reference ce can be found here :
http://www.upvise.com/developer/max.xsd
| Tag Name |
Attributes |
Description |
| <max> |
id
version |
the root element of a MAX application |
| <title> |
|
set the title of the application. |
| <description> |
|
a description for the application. Optional |
|
<category> |
|
category of the application. Optional |
|
<datasrc> |
id
external
orderby
orderbydesc |
defines a new data source for the application |
| <webservice> |
ttl |
sets the URL of the web service for this data source. |
|
<field> |
type="primarykey | string | integer | date"
values="value1:label1 | value2:label2 | ...." |
defines a field in a data source |
| <page> |
id
nextprevious="true"
style="list | form | editform"
anim="left | right | none"
onload
redirect |
declares a page, representing one screen on the phone |
|
<query> |
id
type="select | insert | update | updatemultiple | delete | sendget | sendpost | rss"
groupcount |
defines a data query on a data source to be used in a page. |
|
<title> |
|
set the title of the page (optional) |
|
<item> |
id
href
onclick
type="text | textarea | select | selectmulti | checkbox | numeric | decimal |email |
phonenumber | date | password | confirm"
label="[shortlabel] | [longlabel] | [editboxlabel]"
options="value1:label1 | value2:label2|..."
selected="true | false"
visible="true | false"
icon="new | bluearrow |checked |unchecked |reddot |bluedot | greendot | filter | [a number]"
style="sep | header" |
Defines an item in a list or in a menu |
|
<textarea> |
id
onclick
visible="true|false"
|
Defines a text area of HTML formated content. Takes the entire page. |
|
<action> |
id
href
onclick
visible
type |
defines a custom menu item for the page. |
<max>
This is the root tag for the MAX File. It defines a MAX application. A <max>
element contains
Attributes:
- id="companyid.appid" (mandatory)
- Uniquely identifies a MAX app amongst all others.
Its value must be in the form companyid.appid. companyid identifies
your company is assigned to you by Upvise at your request. appid. The system companyid
is reserved by the Upvise client to defined system applications, such as system.home,
system.settings. See the list of system MAX applications.
- version="major.minor.build" (mandatory)
- Set the version number for this MAX app. It allows automatic MAX application deployment to the Upvise client on mobile phones.
<title>
The title tag directly under the max tag defines the name of the application as it appears in the user list of applications on the phone.
This element is mandatory.
<description>
gives a short description of the MAX app. it is used when uplaoding the MAX app to the Upvise catalog of apps.
This element is optional.
<category>
Used by the MAX app catalog to categorize the application. The value is a category
name.
This element is optional.
<datasrc>
Declares a new data source for the MAX application. Parent tag is <max>.
Multiple
<datasrc> tags can be declared.
Child elements:
Attributes:
- id (mandatory)
- The datasource id. Must be unique amongst all other datasources. Used to build queries.
See <query> tag.
- orderby(optional)
- Indicates that the data is sorted in ascending order using the field name specificed in orderby. If present this attribute value must contain on of the field name of the data. This attribute is mutually exclusive with orderbydesc
- orderbydesc(optional)
- Same as orderby but the data is sorted in descending order.
- external="companyid.appid" (optional)
- If present, the value of this attribute must be the name of another max application, for example external="unybiz.tasks". this attribute is used to reference a data source is declared in another application. In this case, The datasource tag must not contain any sub nodes(no <webservice> node and no <field> node).
<webservice>
the content of this tag is the absolute URL of the web service associated with the
data source. Support the {UWS.BASE}, {UWS.PUBLIC} and {UWS.USER} variable pointing
to Upvise base web services servers.
This element is optional. If not specified, the datasource data are only local and
cannot be synchronized with a server.
<field>
Defines a field for the data source. Content of this tag is the field name, it must
contains only a to z characters. Field names are used when defining queries in a
<query> tag.
The following attribute is supported:
- type="primarykey|string|integer|date|list" (mandatory)
-
You can have only one primarykey field in a data source. Its name MUST BE id. Primary key are of type string.
- values="value1:label1|value2|label2|...." (optional)
- Defines an optional list of value, label pairs which restraint the possible
values for the field. Only integer values are supported. You can then display the
associated label instead of the actual value when performing data binding
using the following syntax : {data.fieldname.displayvalue}.
<page>
Declares a new page for the MAX application. A page contains:
A page supports the following attributes:
- id (mandatory)
- Identifier of the page. Must be unique amongst all other pages. Used to navigate to other pages using the href attribute of the
<item> tag.
- nextprevious="true" (optional)
- Enables next / previous page navigation using the left / right arrow keys.
- style="list|form|menu" (optional)
- Customize the display of the page. Default value is list.
Use style="form" to add a background border around the list. you can also use the attribute style="sel" on item node in the list to separate the item from the previous one. It enables to group items into groups.
Use style="menu" to display each item as a menu button. Usefull for confirmation or popup list of menus.
<query>
Defines a query to be used with the current page. value of the tag is a url in the
format : datasourceid?field1=value1&field2=value2 .....
Attributes:
- id (mandatory)
-
identifier for the query, must be unique amongst all other queries in the current
page. Used to perform data binding {queryid.fieldname} for select
queries, and in the the query.execute() function in for update/insert/delete
queries.
- type="select|insert|update|delete|rss|sendget|sendpost" (mandatory)
- Defines the type of the query. Queries of type select and
rss are used to perform databinding on other elements during the
page rendering. insert, update and delete queries are performed
only against local datasources and are called using the queryid.execute() script in onclick
attribute on a <item> element.
sendget and sendpost
queries are used to send data to any URL by HTTP GET or POST and are also called
using a query.execute() script.
- groupcount (optional)
-
the name of one of the fields of the data source referenced by the query. This attribute
allow to use the {queryid.groupcount(value)} script variable to compute the number
of records matching the a certain value for this groupcount field. It is similar
to the COUNT() keyword in the SQL language.
-
<title> (under the page element)
Set the page title which appears on the top of the screen. <item>
This is one of the most imporant visual tags in the MAX language: It is basically
a list item in a <page> element.
When clicked, a item can have the following behavior:
- navigate to annother page using the href attribute
- execute some script, such as insert, update or delete queries, or manipulate the
DOM (Document Object Model) of the Upvise client.
- popups a edit box (attribute type=text) or change its content bycling throught possibles
option values (attribute type="select" and options attribute)
The tag content contains the text to displayed for the item.
Attributes:
- id (optional)
- identifies the item. Used by the {this.id}
variable or by the item.edit() script function
- href="pageid|max://appid/pageid" (optional)
- Defines a link for this item. A link can be another page in the current MAX application,
in this case href="pageid", where pageid is the
id attribute of the <page> in the current app. It can
also be another page in another MAX application, href="max://maxid/pageid".
maxid is the id attribute of the other <max>
application, and pageid the id attribute of the target
<page>. If no pageid is specified, it opens the first
page of the target MAX application. For example href="max://system.home"
goes to the home screen of the Upvise client.
- onclick="some script" (optional)
- contains some script to be executed when the user presses the center button of the phone
on this item. The onclick script is always exeucted because the navigation to the
href link occurs, if any. If the script contains some function which already navigates
to a page, the navigation to the href link does not occur. See the
Script Reference.
- type="text|textarea|select|seletmulti|checkbox|numeric|decimal|phonenumber|date|password|confirm" (optional)
- by default <item> text content is readonly. If a type atribute is set, the
text content of the item is editable. See below the editable
item section
, combo box item section and
check box item section
for more details.
- label="[shortlabel]|[longlabel]|[editboxlabel]" (optional)
- Contains a label description, displayed left to the item content when a
type attribute is present. A shortlabel is displayed when
the text content is not empty, left to it. a longlabel can be displayed
instrad of the shortlabel when the item text content is empty and
finaly and editboxlabel is used in the dialog box title for modifying
the content, Both longlabel and editboxlabel are
optional.
- options="value1:label1|value2:label2|...." (optional)
- This attribute is to be used when type="select" is specified. it contains a pipe
separated list of couple (value:label) containing all possibles values for the combo
box item.
- selected="true|false" (optional)
- if present, the current <item> is selected when the page is displayed. If
not present, the first item in the list is selected. possibles values are true or
false, but the value of the attribute can contain script variables,
dynamically resolved to true or false as well.
- visible="true|false" (optional)
-
if visible=false, the item is not displayed in the list or in the menu, but
it is still scriptable using the item.edit() function. By default, items are visible.
- icon="new|bluearrow|checked|unchecked|reddot|bluedot|greendot|filter|[a
number]" (optional)
- Displays a small icon on the right of the item. It can be used to display the
number of items if the value of the attribute is a positive integer number.
Editable item
To define an editable item, use the type="text" or type="textarea"
attribute. if you
want to further restrict the kind of data the user can enter, use:
- type="numeric" for positive/negative numeric numbers (+-0 to 9)
- type="decimal" for positive/negative decimal numbers
- type="phonenumber" for entering phone numbers
- type="date" to enter a date
- type="confirm" to display a confirm dialog box with Yes / No. If
the user select Yes, the onclick and href attribures will be executer. Used to confirm
before deleing record items.
You can also the optional label attribute to display a label left to the
item text.
When the user presses the enter button on the phone, a edit box dialog appear and
allows to modify the item text content. If the user modifies the content, the
onclick script and then the href link are executed.
Combo box item
To define a combo box, use type="select" or type="selectmulti"
and set in the
options attribute all posssibles values and labels for the combo
box. Use also the optional label attribute to display a label left
to the combo box.
When the user presses the enter button on the phone, the text of the item cycles
through all possibles values for the combo box. After each change of the content
the onclick script is executed if any. You can use the
{this.text} script variable in the onclick attribute of
the item to retrieve the current value of the item.
Check box item
To define a checkbox use type=checkbox. Use also the optional label
attribute to display a label left to the checkbox.
A checkbox appears instead of the text content. To set a checked state, set the
item text content to 1, or 0 for unchecked.
When the user presses the enter button on the phone, the state of the checkbox toggles
between checked and unchecked. After each change of the state, the onclick script
is executed if any.
<textarea>
Displays an text area containing the HTML formated content of this element in the
entire phone screen. Only one <textarea> element is authorized within a <page> element and cannot be mixed with <item>
elements.
Attributes:
- id (optional)
-
identifies the item. used by the {this.id}
variable or by the item.edit() script function
- onclick="some script" (optional)
-
contains some script to be executed when the user clicks on an hyperlink in the
HTML content. You can use the {document.selectedlink}
variable inside the onclick attribute to retrieve the href
attribute of the selected hyperlink and implement a custom behavior, such as navigation
to another page. See Variable Reference and
Script Reference for more information.
- visible="true|false"
(optional)
-
if visible=false, the item is not displayed in the list or in the menu, but it is
still scriptable using the item.edit() function. By default, items are visible.
<action>
Defines an action to be performed on the page, usually like Add or Edit. Mulitple
<action> tags are supported but it is recommanded to use only one for most
page to have a intuitive UI. The tag content contains the text to displayed
for the item. The attribute supported are a subset of the <item>
tag:
Attributes:
- id (optional)
-
identifies the item. Used by the {this.id}
variable or by the item.edit() script function
- href="pageid|max://appid/pageid" (optional)
-
Defines a link for this item. A link can be another page in the current MAX application,
in this case href="pageid", where pageid is the
id attribute of the <page> in the current app. It can
also be another page in another MAX application, href="max://maxid/pageid".
maxid is the id attribute of the other <max>
application, and pageid the id attribute of the target
<page>. If no pageid is specified, it opens the first
page of the target MAX application. For example href="max://system.home"
goes to the home screen of the Upvise client.
- onclick="some script" (optional)
-
contains some script to be executed when the user presses the center button of the
phone on this item. The onclick script is always exeucted because the navigation
to the href link occurs, if any. If the script contains some function which already
navigates to a page, the navigation to the href link does not occur. See the
Script Reference.
- type="text|textarea|select|seletmulti|checkbox|numeric|decimal|phonenumber|date|password|confirm"
(optional)
-
by default <item> text content is readonly. If a type atribute is set, the
text content of the item is editable. See below the editable
item section , combo box item section and
check box item section for more details.
|