Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Grid SelectionMode=Single, toggling effect, how to stop?

Dino Fancellu
7 years ago May 22, 2015 3:36pm
Fred B.
7 years ago May 23, 2015 3:16pm

Hi Dino,

You can achieve this with SelectionModel. If grid set as "SelectionMode.SINGLE", an instance of SingleSelectionModel (extend SelectionModel) is created. This class has a method "setDeselectAllowed". Below example of code:

((SingleSelectionModel) grid.getSelectionModel()).setDeselectAllowed(false);


Dino Fancellu
7 years ago May 23, 2015 3:28pm

Brilliant, that is exactly what I wanted.

In Scaladin its

val single=selectionModel.asInstanceOf[Grid.SelectionModel.Single]