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

Depending on the type of front-end, TABLE containers controlled by DISPLAY ARRAY dialog use a default rendering for the current row, 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>
Note: Depending on the front-end platform, some widgets may support different highlight colors to the system defaults. If your application is intended for several types of front-ends, consider testing the style attributes with all of them.

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:
    • On GBC and GDC, the current row is highlighted.
    • On GMA and GMI, the current row is not highlighted.
  • If highlightCurrentRow=yes, the current row is highlighted (default with GDC and GBC).
  • If highlightCurrentRow=no, the current row is not highlighted (default with GMA and GMI).
  • The attribute highlightCurrentCell is ignored.

DISPLAY ARRAY using FOCUSONFIELD attribute

When using a DISPLAY ARRAY with FOCUSONFIELD attribute:

  • By default, the current cell is 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 (default).
  • If highlightCurrentCell=no, the current cell is not highlighted.
Note: Exception on GDC:
  • The highlightCurrentRow attribute is ignored (due to platform limitations).

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).
Note: Exception on GMA and GMI:
  • INPUT ARRAY is not yet supported.