Show TOC

Variants Locate this document in the navigation structure

 

A variant is a list of alternative cells. It is created using aggregation Add Cell Variants on the TableColumn . The following types of cell variants:

TableStandardCell

This is a normal cell with its own cell editor that you can use, for example, to provide different cell editors in the same column (see below).

TablePopinToggleCell

Has no cell editor and can only be used to expand and collapse popins.

TableSingleMarkableCell

Represents a cell that can be selected. For more information, see TableSingleMarkableCell.

TableMultiEditorCell

You can add multiple cell editors, that is, multiple links to one table cell using TableMultiEditorCell. This type of cell can be used for "one click actions". The types of cell editors are however restricted.

TableSummaryCell and TableHierachySummaryCell

These cell variants are reserved for the ABAP List Viewer (ALV).

Procedure for Creating Cell Variants
  1. On the relevant TableColumn choose Add Cell Variant from the context menu.

  2. Enter an ID, and choose, for example, the entry TableStandardCell or TableMultiEditorCell as the Type.

  3. Assign a variantKey to your new cell variant.

    The variantKey is required for selecting the variant. Each cell variant requires a unique variantKey.

  4. Add an editor to your cell variant. In the context menu, choose Add Editor.

  5. Assign an ID to the cell editor and choose the required Type, e.g. InputField.

  6. Bind the editor to the data source, by binding property value to the corresponding context attribute.

  7. Define the selectedCellVariant for the TableColumn.

    If selectedCellVariant has the same value at runtime as variantKey, the corresponding cell variant is used.

    If selectedCellVariant is empty, no cell variant is used, and instead the cell editor of the table column is displayed. You can set property slectedCellVariant to a fixed value. Then the relevant cell variant is used for each cell of this column. This is useful, if you want, for example, to reserve the whole table column for the TablePopinToggleCell, or always use the same SingleMarkableCell.

    You can also use context binding to have different cell variants and cell editors in different rows in the same column. To do this, you bind selectedCellVariant to an attribute that appears beneath the dataSource, and you fill it with the variantKeys of the cell variants of the column, or you leave it empty if you want to display the cell editor of the column.

Example

You can find an example to test cell variants TableStandardCell, TableMultEditorCell and TablePopinToggleCell in the system in component WDR_TEST_TABLE_CELL_VARIA:

  • In the first cell a TablePopinToggleCell is used to open and close the popin.

  • The Actions column contains a TableMultiEditorCell where you can find almost all possible editors.

  • The last column displays how TableStandardCells are used to add various cell editors to a column (here, TextEdit, CheckBox, DropDownByKey).

  • You can change and test the effect of the settings in the underlying view browser.