From 4ea2151053469f1092afaeab29587353c001e887 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 10 Oct 2016 22:15:16 +0300 Subject: Add Grid.refreshRows to allow refreshing individual rows (#16765) Change-Id: I554d7b6ca60840bab3a032daa4847e7271086e27 --- .../src/main/java/com/vaadin/v7/ui/Grid.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'compatibility-server/src') diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java index 6c811d070e..ce78fa33cf 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java @@ -6733,6 +6733,22 @@ public class Grid extends AbstractComponent return itemId; } + /** + * Refreshes, i.e. causes the client side to re-render the rows with the + * given item ids. + *

+ * Calling this for a row which is not currently rendered on the client side + * has no effect. + * + * @param itemIds + * the item id(s) of the row to refresh. + */ + public void refreshRows(Object... itemIds) { + for (Object itemId : itemIds) { + datasourceExtension.updateRowData(itemId); + } + } + private static Logger getLogger() { return Logger.getLogger(Grid.class.getName()); } -- cgit v1.2.3