From a00429697b8340a56568465694cac6549954a51f Mon Sep 17 00:00:00 2001 From: Artur Date: Fri, 13 Jan 2017 11:54:01 +0200 Subject: Make it possible to deselect what was selected on the server (#8235) * Make it possible to deselect what was selected on the server Fixes #8221 --- .../client/connectors/SingleSelectionModelConnector.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'client') diff --git a/client/src/main/java/com/vaadin/client/connectors/SingleSelectionModelConnector.java b/client/src/main/java/com/vaadin/client/connectors/SingleSelectionModelConnector.java index ea0d6171af..55c1eddf61 100644 --- a/client/src/main/java/com/vaadin/client/connectors/SingleSelectionModelConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/SingleSelectionModelConnector.java @@ -153,8 +153,14 @@ public class SingleSelectionModelConnector extends @Override public boolean deselect(JsonObject row) { - if (getRowHandle(row).equals(selectedRow)) { - select(null); + if (isSelected(row)) { + // If no selection has happened client side, then selectedRow is + // null but must be set so that a deselection event with the + // correct key can be sent to the server + selectedRow = getRowHandle(row); + selectedRow.pin(); + + return select(null); } return false; } -- cgit v1.2.3