ui.Dialog.setCellAttributes

Define cell decoration attributes array for the specified list (singular dialog only).

Syntax

setCellAttributes(
   attributes ARRAY )
  1. attributes is a program array defining the cell attributes.

Usage

In an INPUT ARRAY or DISPLAY ARRAY dialog, the setCellAttributes() method can be used to specify display attributes for each cell.

Important: This feature is not supported on mobile platforms.

The setCellAttributes() method is designed for dialog programming, where only one screen array is used (for example, in a singular DISPLAY ARRAY dialog). An equivalent method called setArrayAttributes() can be used, when several screen arrays are defined in a multiple dialog, to be able to idenfify the list by the name of the screen array.

Possible values for cell attributes are a combination of the following:

Define an array with the same number of record elements as the data array used by the INPUT ARRAY or DISPLAY ARRAY. Each element must have the same name as in the data array, and must be defined with a character data type (typically: STRING):

DEFINE data DYNAMIC ARRAY OF RECORD
         pkey INTEGER,
         name VARCHAR(50)
       END RECORD
DEIFNE attributes DYNAMIC ARRAY OF RECORD
         pkey STRING,
         name STRING
       END RECORD

Fill the display attributes array with color and video attributes. These must be specified in lowercase characters and separated by a blank (ex: "red reverse"):

FOR i=1 TO data.getLength()  -- length from data array!
    LET attributes[i].name = "blue reverse"
END FOR
Then, attach the array to the dialog with the setCellAttributes() method, in a BEFORE INPUT or BEFORE DISPLAY block:
BEFORE DISPLAY
   CALL DIALOG.setCellAttributes( attributes )
Like data values, if you change the cell attributes during the dialog, these are not displayed automatically unless the UNBUFFERED mode is used.
ON ACTION modify_cell_attribute 
   LET attributes[arr_curr()].name = "red reverse"
If you set NULL to a element, the default TTY attributes will be reset:
ON ACTION clean_cell_attribute 
   LET attributes[arr_curr()].name = NULL