From b3022c7f95ddca0a90ecfd8b9593941847a82998 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 --- server/src/main/java/com/vaadin/ui/Grid.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'server') diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java index e7eed7725f..34826bf6ee 100644 --- a/server/src/main/java/com/vaadin/ui/Grid.java +++ b/server/src/main/java/com/vaadin/ui/Grid.java @@ -6670,6 +6670,22 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, 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