The Dialog class / ui.Dialog methods |
Appends a new row in the specified list.
The appendRow() method appends a row to the end of the list. This method does not set the current row or raise any BEFORE ROW / BEFORE INSERT / AFTER INSERT / AFTER ROW control blocks. It is quite similar to appending a new element to the program array, except the internal registers are automatically updated (like the total number of rows returned by getArrayLength()). If the list was 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. New row is inserted at the end of the list with selection flag set to zero.
This method must not be called in control blocks such as BEFORE ROW, AFTER ROW, BEFORE INSERT, AFTER INSERT, BEFORE DELETE, AFTER DELETE, it is designed to be used in an ON ACTION block.
After the method is called, a new row is created in the program array, so 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 if you want to give the focus.
The appendRow() method does not create a temporary row as the implicit append action of INPUT ARRAY; The row is considered as permanent once it is added.
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