Row and cell highlighting in TABLE

TABLE containers can be configured with presentation styles, to control row and cell highlighting, using specific foreground and background colors.

Purpose of row/cell highlighting style attributes

TABLE containers use a default rendering for the current row when controlled by DISPLAY ARRAY dialog, and a default rendering for the current cell, when using INPUT ARRAY, INPUT or CONSTRUCT.

The following style attributes can be combined to change the rendering of the current row or current cell:
  • highlightCurrentRow (yes/no): Controls current row highlighting.
  • highlightCurrentCell (yes/no): Controls current cell highlighting.
  • highlightColor: Defines the background color.
  • highlightTextColor: Defines the text/foreground color.

The highlightColor / highlightTextColor can get color values. If these attributes are not specified and highlighting is required for the row or the cell, the front-end will use platform default highlighting colors.

Note: When using a dialog allowing user input such as INPUT ARRAY, cells can be edited and text can be selected in editor-based field types. When a highlight colors are used at the cell level, the front-ends will render the selected text accordingly.
A TABLE style can for example be defined as follows:
<Style name="Table.custom_style">
  <StyleAttribute name="highlightCurrentRow" value="no"/>
  <StyleAttribute name="highlightCurrentCell" value="yes"/>
  <StyleAttribute name="highlightColor" value="red"/>
  <StyleAttribute name="highlightTextColor" value="yellow"/>
</Style>

Regular DISPLAY ARRAY (no FOCUSONFIELD attribute)

When using a regular DISPLAY ARRAY with row-level focus granularity, the rendering of the current row is as follows:

  • By default, the current row is highlighted.
  • If highlightCurrentRow=yes, the current row is highlighted.
  • If highlightCurrentRow=no, the current row is not highlighted.
  • The attribute highlightCurrentCell is ignored.
Figure: Table with current row highlight using DISPLAY ARRAY

Table rendering with with current row highlight color red and white text.

DISPLAY ARRAY using FOCUSONFIELD attribute

When using a DISPLAY ARRAY with FOCUSONFIELD attribute, with the classic table rendering:

  • By default, the current cell is highlighted (other cells of the current row are not).
  • If highlightCurrentRow=yes, the current row is highlighted.
  • If highlightCurrentRow=no, the current row is not highlighted (default).
  • If highlightCurrentCell=yes, the current cell is highlighted (default).
  • If highlightCurrentCell=no, the current cell is not highlighted.

With listview table rendering, the highlightCurrentCell attribute is ignored.

Figure: Table with current cell highlight using DISPLAY ARRAY + FOCUSONFIELD


Table rendering with with current row highlight color green and yellow text.

INPUT ARRAY

When using an INPUT ARRAY (and INPUT, CONSTRUCT):

  • By default, the current cell is not highlighted.
  • If highlightCurrentRow=yes, the current row is highlighted.
  • If highlightCurrentRow=no, the current row is not highlighted (default).
  • If highlightCurrentCell=yes, the current cell is highlighted.
  • If highlightCurrentCell=no, the current cell is not highlighted (default).
Figure: Table with current cell highlight using INPUT ARRAY


Table rendering with with current row highlight color yellow and black text.