From 5db6f100da4c66ce394dffdfe16689be188314f1 Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Fri, 21 Aug 2015 14:17:17 +0300 Subject: Fix AbstractRemoteDataSource cache clearing (#18630) This patch also reduces the amount of RPC calls when dropping rows from cache. Change-Id: Ib69a807883bc885dcd877a008cec16e44fa2bfdd --- server/src/com/vaadin/data/RpcDataProviderExtension.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'server/src/com') diff --git a/server/src/com/vaadin/data/RpcDataProviderExtension.java b/server/src/com/vaadin/data/RpcDataProviderExtension.java index 403cc4c016..2ec100eba6 100644 --- a/server/src/com/vaadin/data/RpcDataProviderExtension.java +++ b/server/src/com/vaadin/data/RpcDataProviderExtension.java @@ -123,7 +123,7 @@ public class RpcDataProviderExtension extends AbstractExtension { * the item ids for which to get keys * @return keys for the {@code itemIds} */ - public List getKeys(Collection itemIds) { + public List getKeys(Collection itemIds) { if (itemIds == null) { throw new IllegalArgumentException("itemIds can't be null"); } @@ -698,8 +698,11 @@ public class RpcDataProviderExtension extends AbstractExtension { } @Override - public void dropRow(String rowKey) { - activeItemHandler.dropActiveItem(keyMapper.getItemId(rowKey)); + public void dropRows(JsonArray rowKeys) { + for (int i = 0; i < rowKeys.length(); ++i) { + activeItemHandler.dropActiveItem(keyMapper + .getItemId(rowKeys.getString(i))); + } } }); -- cgit v1.2.3