Updating on-screen tables


AR System application developers can create workflow that temporarily adds or deletes rows in list view, tree view, and cell-based tables. This workflow affects on-screen tables only and does not require calls to the server, which improves performance. Both users and workflow can interact with these temporary changes as if they were permanent. To make the changes permanent, developers can create table loop guides to commit the changes to the AR System server database.

Results list, alert list, and server-side tables do not support this feature.

In this topic, "row" refers to a row in list view tables, a node in tree view tables, and a cell in cell-based tables. When you add a temporary table row, the new row does not display any cell background color. For more information, see Setting-table-colors.

To update tables on-screen only

  1.  Create active links that use the following Run Process commands to add or delete table rows on-screen.

    Along with these commands, use existing workflow functionality, such as table loop guides, to create logic that can determine the row index at which to add or delete rows based on existing table data and on data to be added to the table.

    • PERFORM-ACTION-TABLE-ADD-ROW—This command inserts an empty row at the specified position on-screen and sets the row state to New in memory. Both users and workflow can see and select the row. The new row does not display any cell background color (see Setting-table-colors). This command does not commit the row to the database.
      For example, suppose this command is executed for row index 3 on a table containing the following records:
      AddTableRow_1.GIF
      When the command runs, an empty row is added to list view, tree view, and cell-based table as shown in the following figures.

      List view table with an empty row inserted at index 3
      AddTableRow_2_no_x_entries_text.GIF

      Tree view table with an empty node inserted at index 3
      AddTableRow_3.GIF

      Cell-based table with an empty cell inserted at index 3
      AddTableRow_4_no_x_entries_text.GIF
    • PERFORM-ACTION-TABLE-DELETE-ROW—On-screen, this command removes the row at the specified index from view. In memory, this command sets the row's state to Deleted. It does not, however, remove the row from the database. So, users cannot see or select the row, but the row is visible to workflow, which can still interact with it. For example, table loop guides can step through the row.
    • PERFORM-ACTION-TABLE-SET-ROWSTATE—This command helps workflow manage on-screen table rows without contacting the database.
      For example, when a user adds an on-screen row, its ROWSTATE is set to 2 (New) in memory, so workflow designed to commit such rows to the database finds them by searching for ROWSTATE 2. To enable users not to commit such rows to the database, you might provide an Undo button whose workflow uses this command to change the state of specified rows from ROWSTATE 2 to ROWSTATE 0 (Unchanged). They are then bypassed by workflow designed to commit new on-screen rows to the database. Because of this, you can undo the table row additions without calling the server and database to refresh the table.
    • PERFORM-ACTION-TABLE-CHANGE-ROW-COL-VISIBILITY—On-screen, this command hides the contents of a column field for the current row. You can use this command for list style tables and cell-based tables only
      For more information about these commands, see Using-Run-Process-and-PROCESS-commands. For an example of how these Run Process commands can be used, see Example-Temporarily-displaying-table-rows-on-the-screen.
  2. If you added an empty row in step 1, use one of the following methods to add data to the row:
  3. Provide a mechanism that enables users to commit temporary table changes to the database.
    For example, create a table loop guide that is triggered when a user clicks Save. The guide can check for a row's state and then take appropriate action on the row.
    To discover the state of a row during runtime, the guide can use the $ROWCHANGED$ keyword, which returns one of these states: 

    Row state

    Value

    Description

    Loaded or Unchanged

    0

    When a table is refreshed, the state of all its rows is set to Loaded (0).

    Modified

    1

    When either of the following actions occurs, a row's state is set to Modified (1):

    • A Set Fields action sets data to a Loaded row.
    • Users type or paste data into an editable column.

    New (added)

    2

    When an empty row is added to a table, its state is set to New (2).

    Deleted (removed)

    3

    When a row's state is set to Deleted (3), it is hidden from users but visible to workflow.

    If PERFORM-ACTION-TABLE-DELETE-ROW set the row state to Deleted, you could run an action to delete that record from the database. If PERFORM-ACTION-TABLE-ADD-ROW set the row state to New, you could run a Push Fields action to add the row to the database.

    Warning

    If one of the following actions occurs before the changes are saved, the changes will be lost:

    * The table is refreshed (browsers).

    * The table is re-sorted (browsers).

    * The form is closed (AR System server does not prompt users to save their changes).

For more information, see:

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*