Show TOC

Selection in TablesLocate this document in the navigation structure

Use

The selectionMode property generally determines the selection response and whether a selection is made in the Table. If this value is none, no selection is made. In all other cases, the user can set lead and secondary selections, which means that the selection status of context elements that correspond to a table row are transferred with their colors, and the user can then change the selection status by using the mouse, keyboard, or a selection menu.

Selection in a Table is configured differently depending on whether application parameter WDUIGUIDLINE is set to GL11 or to GL20.

WDUIGUIDELINE=GL11

If you click a selection button in the selection column (or press SPACE), the corresponding row is selected and all previously selected rows are deselected. This is also the case if you click another cell in the table, provided that you do not use a cell editor that can be changed ( InputField, CheckBox, and so on) or a cell editor that can be clicked itself ( Button, LinkToAction, and so on). Note that the selection does not change if you click a link, Button, or the expand/collapse icon in a tree column.

Selection column in a table

If the Table supports the lead selection (that is, selectionMode=auto, single, or multi), the lead selection is always set. Otherwise ( selectionMode=singleNoLead or multiNoLead), a "simple" selection is set.

If the user selects a cell that is already selected while holding CTRL, the cell is deselected. Exception: It is the lead selection and the context node has the selection cardinality 1..1 or 1..n.

In the case of selectionMode=multi or multiNoLead, multiple selections can be carried out, which means that you can select multiple cells by clicking them (or pressing SPACE) while simultaneously holding SHIFT or CTRL. This does not affect the lead selection unless it is deleted by CTRL+click as described above.

The selection column can be hidden using the property SelectionColumnDesign. However, you should only hide it for readOnly Table s. Otherwise, it may no longer be possible to select a Table if, for example, all of the cell editors comprise InputField s, Button s, and so on.

Navigating through the Table using the cursor does not affect the selection.

Selection and Hierarchy Menu

Table s can have selection switches (table selection menu) in the top left corner.

  • If multiple selections can be made in the Table, that is, if selectionMode = multi or multiNoLead, or if selectionMode=auto and dataSource has selection cardinality 0..n or 1..n, the user can select or deselect rows using the menu. If the user chooses Select All, the lead selection stays. If no lead selection is set, no lead selection can be set when Select All is chosen. If user chooses Deselect All, the lead selection is deleted too.

    You can find an example in the system in component WDR_TEST_TABLE under Selection.

  • If Table is provided with TableRowArrangement of type TableRowGrouping, the user can also expand or collapse everything in addition to Select All and Delete Selection.

    You can find an example in the system in component WDR_TEST_TABLE under RowGrouping.

    Selection Switch

    Selection Switch and Hierarchy Menu

    Caution

    The selection switch (table selection menu) is not available for hierarchical tables ( TreeByKeyTableColumn, TreeByNestingTableColumn).

Selection Behavior and Performance Issues

A selection always leads to a roundtrip if the lead selection is changed, the event onSelect of Table is bound, or the RowArrangement TableRowGrouping is used.

In the same way, this means that a Table without TableRowGrouping, without an onSelect action, and with selectionMode = multiNoLead or singleNoLead selections does not trigger a roundtrip and, therefore, enables you to work more efficiently with the Table and improves user-friendliness.

A secondary selection does not trigger a roundtrip unless you use the onSelect event of the Table. Furthermore, TableRowGrouping is not permitted and selectionChangeBehaviour must be set to auto.

WDUIGUIDELINE=GL20

Under certain conditions the user's selection follows the focus. The selection moves with the focus if the user uses the keyboard to navigate in the Table. If the user clicks on a cell editor (for example, to focus an InputField, or to select a Button), a selection is made.

This behavior is only triggered if the selection of a Table does not cause a roundtrip, in other words, if the following conditions are met:

  • The Table does not use a RowArrangement of type TableRowGrouping.

  • Property Table.SelectionMode is set to either multiNoLead or singleNoLead.

  • No event handler is set for onSelect or onLeadSelect.

    If none of these conditions are met, the previous behavior applies (see GL11).

As already mentioned in the case of GL11, no roundtrips are triggered during the selection process, which leads to improved and quicker use of the Table. These settings should, therefore, take precedence wherever possible.

It is also possible to use a Table with a lead selection for GL20.

Caution

If GL20 is set, Table.selectionChangeBehaviuour=auto must always be set.

The visualization of the lead selection and the secondary selection is the same; they are no longer displayed differently on the screen. Rows with lead selection and secondary selection have the same dark orange background (if the theme is set to SAP_Tradeshow_plus).