Hi,
i have a grid with SelectionMode MULTI. When i click a row i can fetch the item with a addItemClickListener but the row is not hightlighted. So i would like to add it programatically, but get an Nullpointer when doing:
//Code
grid.addItemClickListener((selectionEvent -> productSelected(selectionEvent)));
//more Code
private void productSelected(ItemClickEvent<Product> selectionEvent) {
grid.getSelectionModel().getSelectedItems().add(selectionEvent.getItem()); //getSelectedItems = NULL
}
How can i archive it: got multi select enabled, but a single line Click should also add the row to the selected items?