MAS 9.2 series framework 3.2.8xx
The UI Components guide places the list among the elements that carry every app; this one takes it apart. The patterns come from the apps IBM ships in the 9.2 series. Every MAML fence is ours, and the pictures come from our Components Explorer app, a small Maximo Mobile app we built for these articles.
The datasource decides what the list looks like#
Here is the fact that reorganises how you read a list. A <data-list> draws its selection controls according to what the datasource behind it says:
selection-mode="multiple"draws a checkbox on every row.selection-mode="single"draws no control in Maximo Mobile. The list looks like one withnoneuntil a tap, and then the tapped row gets a blue bar at its left edge.selection-mode="none"draws nothing, and a tap selects nothing.
The markup of the list does not change. So when a list grows checkboxes you did not ask for, the answer is in the datasource, and when a picker shows none, the answer is there too.

<json-datasource id="fs_l_select_ds_none" src="fs-workorders.js"
id-attribute="_id" selection-mode="none"/>
<json-datasource id="fs_l_select_ds_single" src="fs-workorders.js"
id-attribute="_id" selection-mode="single"/>
<json-datasource id="fs_l_select_ds_multiple" src="fs-workorders.js"
id-attribute="_id" selection-mode="multiple"/>Each tab holds the same <data-list>, bound to one of the three.
The same is true of search. show-search puts the box on the list, and what the box searches is whichever attributes the datasource schema marked searchable. That is decided when you write the schema.
The three parts#
A list is three elements nested one inside the next, and the diagram shows who decides what.
The datasource decides, the data-list binds, the list-item draws one row.
<data-list>binds thedatasource, turns the search box on withshow-search, names the tap handler inon-item-click, and holds the empty state inempty-set-string.<list-item>is the template for one row. It has almost no attributes of its own and it takes any layout inside. In the shipped apps it nearly always holds a border layout.<border-layout>gives the row its shape: the text in the middle, an icon or a chevron at the end, sometimes a status marker at the start. The edges shrink to their content and the middle takes the rest, which is why every row lines up.
<data-list id="ex_list" datasource="locationDS" show-search="true"
search-placeholder-text="Search locations"
on-item-click="openLocation" on-item-click-arg="{event}"
empty-set-string="No locations in this site">
<list-item id="ex_item">
<border-layout id="ex_row" fill-parent="true">
<middle id="ex_mid" vertical-align="center">
<box id="ex_text" direction="column">
<label id="ex_title" label="{item.location}" theme="16-bold"/>
<label id="ex_sub" label="{item.description}" theme="14-regular" wrap="true"/>
</box>
</middle>
<end id="ex_end" vertical-align="center">
<icon id="ex_chev" icon="carbon:chevron--right" size="20"/>
</end>
</border-layout>
</list-item>
</data-list>Inside the list-item, {item.…} means the current row. Outside it you would name the datasource, as {locationDS.item.location}, and inside it you do not have to.
The empty state#
Every list is empty sometimes, and a blank screen reads as a broken app. empty-set-string is the headline and sub-label is the sentence under it. The shipped apps use the sub-label to say what to do next, and so should you. “No requests yet” is a fact; “No requests yet. Tap the plus button to create one” is a screen.

<data-list id="fs_l_empty_list_s" datasource="fs_l_empty_ds" show-search="false"
empty-set-string="No work orders"
sub-label="Tap the plus button to create one.">What happens on a tap#
on-item-click names a method on the page controller. With on-item-click-arg="{event}", the form IBM’s apps use, the method receives the tapped row itself. The handler does one thing in nearly every shipped app: it navigates to the detail page and passes the row along.
export default class LocationListPageController {
pageInitialized(page, app) {
this.page = page;
this.app = app;
}
openLocation(item) {
this.app.setCurrentPage({
name: 'locationDetail',
resetScroll: true,
params: { location: item.location, href: item.href },
});
}
}A page can also be opened with no controller at all. A button in the row names the page with page and hands over values with page-params:
<button id="fs_l_tap_c_btn" kind="ghost" icon="carbon:chevron--right"
page="fs_l_detail"
page-params="{{wonum: item.wonum, description: item.description,
status: item.status, assetnum: item.assetnum}}"/>The sequence below runs that button in our Components Explorer at phone width. The list is scrolled down, and a tap on the chevron of WO-1005 opens the detail page with the values of that row. The back arrow returns to the list.

Watch the third frame. The list page comes back at the top, with its first tab selected again. In our test the page kept neither its scroll position nor its tab. If the user should land on the row they came from, the page has to restore that position itself.
When a tap should navigate and select nothing, put no-select-behavior="true" on the list. Otherwise a datasource with a selection mode will select the row as well, and the user gets a radio button they did not want.
What the detail page does with those params, and how the user comes back, is the subject of the controllers level. The list’s job ends at the tap.
The richer list#
Open a shipped app’s main record list and you will find something else: a <card-group>. It is a list that brings filter, sort, pull-to-refresh, a count and the empty state with it, and it draws each row as a card. The plain data-list is what you use inside a page or a dialog; the card-group is what the main screen is made of.
That is where the choices start. Data-List Patterns in Maximo Mobile, a members piece, shows which list shape fits which job. It also covers how the shipped apps switch one list between several views, and the tree, the grouped list and the grid.
What to read next#
Layout with Containers covers the border layout of a row and the stacked panel, and Forms and Input Fields the form a list often opens. UI Components is the overview, and MAML Basics follows in this series.
The element reference IBM ships is available on your own MAS install. In the Application Configuration application, open the ? menu and choose Component Documentation. The data-list and list-item entries there list every attribute named above.
