My question is very simple but I really didn't find any solution here. I have a Table setSelectable(true), setMultiselect(false), setImmediate(true).

It works fine by first click and moving through the table using arrows. But if I click again to the row already having been selected, then it becomes unselected. How to prevent it? I'd like to have kept just one row always selected.

有帮助吗?

解决方案

As from the Vaadin Book here:

If the user clicks on an already selected item, the selection will deselected and the table property will have null value. You can disable this behaviour by setting setNullSelectionAllowed(false) for the table.

So:

table.setNullSelectionAllowed(false);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top