MAS 9.2 series cheatsheet
Every element, attribute and value on this page is in use on the pages of our Components Explorer. That app passes the strict mobile build of the MAS 9.2 series, so everything here is accepted by the build. One attribute is the exception: saved-query comes from IBM’s apps and from our guide on saved queries. The page makes no claim to list every attribute an element has.
The skeleton of a page#
One of our pages, shortened to one of each part:
<page id="fs_d_load" controller="FsDataController" title="Data: when a datasource loads">
<states id="fs_d_load_states">
<state id="fs_d_load_last" name="last" type="string" value="no call yet"/>
<state id="fs_d_load_go" name="go" type="boolean" value="false"/>
</states>
<maximo-datasource id="fs_d_load_bound" object-structure="mxapiwodetail"
where="siteid="BEDFORD"" order-by="wonum" page-size="3" selection-mode="none">
<schema id="fs_d_load_bound_s">
<attribute name="wonum" unique-id="true" id="fs_d_load_bound_a_wonum"/>
<attribute name="description" id="fs_d_load_bound_a_description"/>
</schema>
</maximo-datasource>
<header-template id="fs_d_load_hdr" title="Data: when a datasource loads"/>
<box id="fs_d_load_body" direction="column" padding="1">
<label id="fs_d_load_last_l" wrap="true" label="Last call: {page.state.last}"/>
<button id="fs_d_load_bound_load" kind="secondary" label="load()" on-click="run"
on-click-arg="{{ds: 'fs_d_load_bound', call: 'load'}}"/>
</box>
</page>A page has four kinds of children: its states, its datasources, a header, and the elements that draw. Every element carries an id, and an id exists once in the whole app. The build stops on a second use.
The guides for this section are MAML Basics, Understanding app.xml.
Bindings#
| You write | It reads |
|---|---|
{page.state.last} | a state of the page |
{app.state.ctlText} | a state of the application |
{fs_d_load_one.item.wonum} | an attribute of the current record of a datasource |
{fs_d_load_bound.state.itemCount} | a state of a datasource |
{item.wonum} | an attribute of the row, inside a list or a card |
label="Last call: {page.state.last}" | text and a binding in one value |
{page.state.touch ? '' : 'Data'} | an expression |
disabled="{page.state.busy}" | a binding for an attribute that is true or false |
on-click-arg="{{ds: 'fs_d_load_bound', call: 'load'}}" | an object as the argument of a handler |
on-click-arg="{item}" | the record of the row as the argument |
Quotes inside an attribute are written as ", as in the where of the skeleton.
The guide for this section is Data Binding.
Structure and layout#
| Element | Use | Attributes |
|---|---|---|
page | one screen | controller, title |
states, state | the values of a page | name, type (string, boolean, number), value |
header-template | the header of a page | title, hide-breadcrumb |
box | puts its children in a row or a column | direction (column, row), padding, horizontal-align, vertical-align, background-color |
border-layout with start, middle, end | regions of a screen | fill-parent |
tabs, tab | tabs, one child per tab | label on the tab |
adaptive-row, adaptive-column | columns that change with the width of the screen | small-width, medium-width, large-width, xlarge-width |
The guides for this section are Layout with Containers, Responsive Design in Maximo Mobile.
Text and media#
| Element | Use | Attributes |
|---|---|---|
label | a text | label, wrap, theme (14-regular, 16-bold) |
field | a value with its label, read only | label, value, hide-label, wrap |
icon | an icon | icon, size (16, 20, 24, 32), fill |
tag | a small coloured mark | label, type (red, green, gray, blue, teal, and more) |
image | a picture | src, title, width |
The guide for this section is Icons and Images.
Actions#
| Element | Use | Attributes |
|---|---|---|
button | runs a method, opens a page or a dialog | kind (primary, secondary, tertiary, ghost, danger), label, icon, on-click, on-click-arg, page, dialog, disabled |
button-group | holds buttons together | align (start, end) |
menu-button, menu-item | a button with a menu | kind and label on the button; label, icon, on-click, on-click-arg on the item |
Some attributes of a button need no controller at all: page="fs_d_kinds" opens a page, and dialog opens a dialog of the page. The buttons guide lists the others.
The guide for this section is Buttons and Actions.
Inputs#
| Element | Use | Attributes |
|---|---|---|
text-input | one line of text | label, value, placeholder, type (text, email, number, tel, url, password), readonly, max-length, on-change |
text-area | several lines | label, value, rows |
number-input | a number | label, value, hide-step-buttons |
date-input | a date | label, value, type, min-date, max-date |
toggle | a switch | label, toggled, on-toggle, on-toggle-arg |
checkbox | a check | label, checked, on-change, on-change-arg |
dropdown | one choice from a datasource | label, datasource, datasource-value-field, datasource-text-field, selected-item, on-change |
smart-input | an input that takes its kind from the attribute | label, value, input-kind, required, readonly, lookup, enable-lookup-buttongroup, select-lookup-attribute |
A value that binds to {datasource.item.attribute} writes into the record, and the datasource then has an unsaved change. Our inputs that belong to no record carry unbound="true".
The guide for this section is Forms and Input Fields in Maximo Mobile.
Lists#
| Element | Use | Attributes |
|---|---|---|
data-list | the rows of a datasource | datasource, show-search, show-count, no-select-behavior, empty-set-string, on-item-click, on-item-click-arg |
list-item | the template of a row | label, sub-label, badge-label, badge-type, page, page-params; or children of its own |
card-group, card | the rows as cards | datasource, card-click, card-click-arg on the group |
<data-list id="fs_d_load_bound_list" datasource="fs_d_load_bound" no-select-behavior="true" show-search="false">
<list-item id="fs_d_load_bound_list_item">
<label id="fs_d_load_bound_list_item_t" wrap="true" label="{item.wonum} · {item.description}"/>
</list-item>
</data-list>The guide for this section is Lists and Data-Lists in Maximo Mobile.
Dialogs, drawers and lookups#
| Element | Use | Attributes |
|---|---|---|
dialog | a window over the page | title, size (xs, sm, md, lg), primary-action-text, on-primary-action, secondary-action-text, on-secondary-action, controller |
sliding-drawer | a panel that slides in from a side | header-text, align (start, end) |
lookup | a list to pick a value from | datasource, lookup-heading, lookup-attributes, show-search, show-count, on-item-click |
Dialogs are children of the page, inside <dialogs>. A button opens one with dialog="its id", and a controller with this.page.showDialog('its id').
The guides for this section are Dialogs and Lookups Overview, the cookbook recipes Add a Dialog and Lookup Field.
Data#
| Element | Use | Attributes |
|---|---|---|
maximo-datasource | rows from Maximo | object-structure, where, saved-query, order-by, page-size, selection-mode, can-load, pre-load, controller |
json-datasource | rows from a file of the app | src, id-attribute, selection-mode, pre-load, search-attributes |
schema, attribute | what a row holds | name, unique-id, searchable, sortable, title, type, sub-type, computed-function |
The Datasource Cheatsheet has these in full, with what each one sends.
Events#
| Attribute | On |
|---|---|
on-click | button, menu-item |
on-change | text-input, checkbox, dropdown |
on-toggle | toggle |
on-item-click | data-list, list-item, lookup |
card-click | card-group |
on-primary-action, on-secondary-action | dialog |
Every event attribute has a partner with -arg at its end, which passes a value to the handler. A handler of on-click gets that value and then the click event. Without the -arg attribute, the click event is its first parameter. The handler of on-change on a text-input runs for each keystroke. The Controller Methods Cheatsheet lists which controller a handler is looked for in.
This page as a PDF, to print or to keep beside the keyboard.
IBM documents every element with all its attributes in the product itself. In the Application Configuration application, open the ? menu and choose Component Documentation.
