ui.Dialog.appendRow
Appends a new row in the specified list.
Syntax
appendRow(
name STRING )
- name is the name of the screen record, see Identifying screen-arrays in dialog methods.
Usage
The appendRow()
method appends a row to the end of the array controlled by the
dialog.
ON ACTION
block. It must not be called in control blocks such as BEFORE
ROW
, AFTER ROW
, BEFORE INSERT
, AFTER
INSERT
, BEFORE DELETE
, or AFTER DELETE
.The method is similar to appending a new element to the program array, except the internal
dialog registers are automatically updated (like the total number of rows returned by getArrayLength()
). If the list
is decorated with cell attributes, the
program array defining the attributes will also be synchronized. If multi-row selection is enabled, selection
flags of existing rows are kept. The new row is inserted at the end of the list with the selection
flag set to zero.
DISPLAY
ARRAY
dialog. Avoid using this method in INPUT ARRAY
. To allow the end
user to append, modify or delete rows in a DISPLAY ARRAY
, use list modification interaction blocks.After the method is called, a new row is created in the program array. You can assign values to
the variables before the control goes back to the user. The getArrayLength()
method
will return the new row count.
The method does not set the current row and does not give the focus to the list; you need to call
setCurrentRow()
and execute NEXT
FIELD
to give the focus.
This method does not execute any BEFORE ROW
, BEFORE INSERT
,
AFTER INSERT
or AFTER ROW
control blocks.
The appendRow()
method does not create a temporary row as the implicit append action of
INPUT ARRAY
; the row is considered permanent once it is added.
Example
ON ACTION append_some_rows
FOR i = 1 TO 10
CALL DIALOG.appendRow("sa")
LET r = DIALOG.getArrayLength("sa")
LET p_items[r].item_quantity = 1.00
END FOR