ui.Dialog.setCurrentRow

Sets the current row in the specified list.

Syntax

setCurrentRow(
   name STRING,
   row INTEGER )
  1. name is the screen array name.
  2. row is the new row in the array.

Usage

Use the setCurrentRow() method to change the current row in an INPUT ARRAY or DISPLAY ARRAY list. You must pass the name of the screen array to identify the list, and the new row number.
DEFINE x INTEGER
DIALOG
  DISPLAY ARRAY custlist TO sa_custlist.*
    ...
  END DISPLAY
  ON ACTION goto_x 
    CALL DIALOG.setCurrentRow("sa_custlist", x)
    ...

Moving to a different row with setCurrentRow() will not trigger control blocks such as BEFORE ROW / AFTER ROW, as the fgl_set_arr_curr() built-in function does.

The setCurrentRow() method will not set the focus; You need to use NEXT FIELD to set the focus to a list. (This works with DISPLAY ARRAY as well as with INPUT ARRAY.)

If the passed row index is lower than 1, the first row will be selected. If the row index is greater than the total number of rows, the last row will be selected.

If the new current row is out of the current page of rows, the dialog will adapt the list offset to make the new current row visible.

If multi-row selection is enabled, all selection flags of rows are cleared, and the new current row gets automatically selected.