Handling the selection

Selection in the table view is managed by an IlpTableSelectionModel. Different kinds of selection models can be set to the table by using the method setSelectionModel of the table view. However, only the IlpDefaultTableSelectionModel allows you to use the method setSelectionMode , as illustrated in the following code sample.

How to handle selection in the table

IlpTable tableComponent = new IlpTable();
// Set a selection mode to select multiple entire rows
tableComponent.setSelectionMode(IlpTableSelectionMode.
  MULTIPLE_OBJECTS_SELECTION);
The different selection modes, defined by the enumerated type IlpTableSelectionMode, are the following:
The following methods can be used to select business objects:
  • addSelectionObject(IlpObject object) adds a business object to the selection (the entire row is selected).
  • removeSelectionObject(IlpObject object) removes a business object from the selection.
  • getSelectedObjects() returns the collection of selected business objects.
  • getSelectedObject() returns the first selected business object (the first in the collection of business objects.)
  • isObjectSelected(IlpObject object) returns true if the given selected object is selected.
  • clearSelection() deselects all the selected objets.
  • selectAll() selects all the visible cells (this means that filtered objects and hidden columns are not selected.)
Similar methods exist in IlpTableSelectionModel to select individual columns and cells.