From 459bb376e4005fdd32b2653a9ba8d8df90b8d560 Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Wed, 25 Nov 2015 12:20:24 +0200 Subject: Fix setSelected in MultiSelectionModel to update row data (#19302) Change-Id: I32c980b2cae199ad2059701e4e04b4a7cb76bafa --- .../server/communication/data/RpcDataProviderExtension.java | 3 ++- server/src/com/vaadin/ui/Grid.java | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'server') diff --git a/server/src/com/vaadin/server/communication/data/RpcDataProviderExtension.java b/server/src/com/vaadin/server/communication/data/RpcDataProviderExtension.java index fed31646f4..55b486d4b6 100644 --- a/server/src/com/vaadin/server/communication/data/RpcDataProviderExtension.java +++ b/server/src/com/vaadin/server/communication/data/RpcDataProviderExtension.java @@ -499,11 +499,12 @@ public class RpcDataProviderExtension extends AbstractExtension { return; } + Collection activeItemIds = activeItemHandler.getActiveItemIds(); List columns = getGrid().getColumns(); JsonArray rowData = Json.createArray(); int i = 0; for (Object itemId : itemIds) { - if (activeItemHandler.getActiveItemIds().contains(itemId)) { + if (activeItemIds.contains(itemId)) { Item item = container.getItem(itemId); if (item != null) { JsonObject row = getRowData(columns, itemId, item); diff --git a/server/src/com/vaadin/ui/Grid.java b/server/src/com/vaadin/ui/Grid.java index 0f3e634ed3..c75013b8c6 100644 --- a/server/src/com/vaadin/ui/Grid.java +++ b/server/src/com/vaadin/ui/Grid.java @@ -1810,12 +1810,18 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, if (!added.isEmpty()) { changed = true; selection.addAll(added); + for (Object id : added) { + refreshRow(id); + } } Set removed = getDifference(selection, selectedRows); if (!removed.isEmpty()) { changed = true; selection.removeAll(removed); + for (Object id : removed) { + refreshRow(id); + } } if (changed) { @@ -5826,8 +5832,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, } /** - * Gets the - * {@link KeyMapper } being used by the data source. + * Gets the {@link KeyMapper } being used by the data source. * * @return the key mapper being used by the data source */ -- cgit v1.2.3