Use Case 2-Copying data between tables
The following procedure describes how to allow users to copy data between two table fields. For example, a table called "Current Inventory" includes a list of inventory items, and a manager needs to remove an item that is broken. With the drag-and-drop function implemented, the manager simply drags the item from the Current Inventory table to a table called "Remove From Inventory."
During the drag sequence, a drag proxy ( ) appears and displays the number of items being dragged. A label (such as "items selected") can appear next to the number. To configure the label that appears in the drag proxy, enter text in brackets ([ ]) in the Label property for the table field. You can enter one, two, or no labels, as described in the following procedure.
To allow users to drag and drop data between table fields
- In the form with the two table fields you want to use in the drag-and-drop sequence, set the Draggable and Droppable field properties for the table fields.
Set the Row Label and Row Label Plural properties for the table whose rows will be dragged.
~|
Field property
~|
Description
~|
What to enter
~|
Row Label
~|
Configures the drag proxy's label when one row is selected. Enter {0} for the count, and include any text before or after {0}.
~|
labelText{0} labelText For example:{0}item selected Using this example,
appears when the user drags over a valid drop target.
appears on an invalid drop target.
~|
Row Label Plural
~|
Configures the drag proxy's label when more than one row is selected. Enter {0} for the count, and include any text before or after {0}.
~|
labelText{0} labelText For example:{0}items selected Using this example,
appears when three rows are selected.
If you do not enter labels, only an icon appears (for example,
).
- Create an active link with the following actions that occur when the Drop execution option occurs on the table:
Run Process — Use the PERFORM-ACTION-TABLE-ADD-ROW command to add a row to the table that will be dragged to.
For example, if the table's field ID is 536870919, then the command would look like this:
PERFORM-ACTION-TABLE-ADD-ROW 536870919- Set Fields — Set the values of the cells in the new row. This means setting the value for each column in the drop target table to the value of each column field in the row being dragged.
The following figure shows an example of the Column fields being set to the value of the Inventory ID, Description, and Name column fields being dragged.
Setting the values for columns