↓ Skip to main content
Three mosaic panels of decreasing width, the widest holding four tiles in one row, the middle four in two rows of two, and the narrowest four stacked in a column

Responsive Design in Maximo Mobile

A Maximo Mobile app runs on a phone in a gloved hand and on a browser at a desk, from the same markup. Two mechanisms carry that: a grid where each column declares its own width per screen size, and a piece of framework state you can read in any binding. This page looks at both, and the shipped apps show which one they lean on.

MAS 9.2 series framework 3.2.8xx 5 breakpoints

This page is about what changes with screen size. For the containers that place things at any size, see its companion, Layout with Containers.

The proportions come from the apps that IBM ships with a 9.2-series install, as Application Configuration shows them. The pictures and the breakpoints come from our own Components Explorer, a small Maximo Mobile app we built for these articles, measured in the preview of our MAF editor. IBM releases about once a month, so details move and the proportions hold.

Two mechanisms respond to the screen size Two mechanisms respond to the screen size
Two mechanisms respond to the screen size

The adaptive grid
#

A form that has two columns on a tablet and one on a phone is built from <adaptive-row> and <adaptive-column>. The row is a container and the column carries the decisions.

<adaptive-row id="fs_f_responsive_row">
  <adaptive-column id="fs_f_responsive_c1" small-width="100" medium-width="50"
                   large-width="25" xlarge-width="25">
    <field id="fs_f_responsive_wonum" label="Work order"
           value="{fs_f_responsive_ds.item.wonum}"/>
  </adaptive-column>
  <adaptive-column id="fs_f_responsive_c2" small-width="100" medium-width="50"
                   large-width="25" xlarge-width="25">
    <field id="fs_f_responsive_status" label="Status"
           value="{fs_f_responsive_ds.item.status}"/>
  </adaptive-column>
  <!-- two more columns: Asset and Location -->
</adaptive-row>

A width is a percentage of the row. 100 is the full width, so two columns at 50 sit side by side, and four at 25 share one line. IBM’s apps write 100, 50, 33 and 25 far more than any other value. A grid of twelve units does not apply here: a column at 6 is six percent wide, a narrow strip, as the last row of the picture shows.

Three screens of Maximo Mobile side by side, at 390, 600 and 1024 points wide. Each shows “Screen size:” with sm, md and lg. At sm the four fields Work order, Status, Asset and Location stand in one column. At md they form two columns of two. At lg they stand in one row of four. A grey box “This box is hidden on sm” appears at md and lg only. At the bottom of each screen, a control row with two columns at medium-width 6 squeezes Work order and Status together from md on.
The same adaptive row at 390, 600 and 1024 points, in Maximo Mobile, in the preview of our MAF editor

The attributes that columns set fall into three groups:

  • Nearly every column sets id, small-width, medium-width and large-width, and most also set xlarge-width, which is the one left out most often.
  • A smaller group sets the alignment per breakpoint: medium-horizontal-align, large-horizontal-align, small-horizontal-align and xlarge-horizontal-align.
  • Only a few columns set hidden.

Most columns declare all four widths. The normal practice is to state every breakpoint explicitly. Leaving one out means inheriting a default nobody on your team will remember.

The row itself is nearly attribute-free beyond an identifier. All the responsive thinking happens one level down.

Alignment can also change per breakpoint, though far less often. A column that centres its content on a phone and pushes it to the start on a desktop is a real need, and only a minority of columns in the shipped apps have it.

Many apps never use the grid
#

The adaptive grid appears in only some of the shipped apps.

That is worth pausing on, because the grid is for forms and dense detail panes. An app that is mostly lists and a map has no use for it. If you are building a list-driven app and the adaptive grid feels like overhead, the shipped apps agree with you.

The five screen sizes
#

The framework maintains the current screen size in application state, and any binding can read it.

<box hidden="{app.state.screen.size === 'sm'}">

That expression is the most referenced piece of state in the shipped apps. It takes five values, and the distribution says which screens these apps are really designed for:

  • sm is read the most.
  • md follows close behind.
  • lg, xlg and max are read rarely.

We measured where one size becomes the next, by widening the same page one point at a time:

SizeWidth of the screen in points
smup to 500
md501 to 700
lg701 to 1024
xlg1025 to 1440
maxfrom 1441

So a phone is sm, and a tablet in portrait at 768 points and in landscape at 1024 points is lg. A page that tests only for md therefore misses most tablets.

sm and md account for the overwhelming majority. The three larger sizes together appear far less often than sm alone.

Two things follow from that. Test on a phone and a tablet first, because that is where the shipped behaviour has been exercised. And treat xlg and max as one case unless you have a reason, since almost nobody has distinguished them.

Which mechanism to reach for
#

The problemThe tool
A form has too many columns on a phonethe adaptive grid, with a width per breakpoint
A whole element should disappear on small screenshidden bound to the screen size
A label should be short on a phone and long on a desktopa binding on the value, using the screen size
A toolbar should wrap when space runs outa button group, which handles it without breakpoints

The grid is declarative and the screen-size binding is a switch, so prefer the grid whenever the answer is a layout and keep the binding for content decisions.

The picture above shows the grid answering the layout question and the hidden box answering the content question, on one page.

What to read next#