4

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.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Hink
  • 1,054
  • 1
  • 15
  • 31

1 Answers1

6

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);
nexus
  • 2,937
  • 3
  • 17
  • 22
  • Thank you, I overlooked this function. I am beginner in Vaadin and in Stackoverflow too. I cannot discover, how to mark your answer as the solution and to close the question. – Hink Mar 23 '14 at 01:24