diff options
author | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2017-06-20 15:55:49 +0300 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-06-20 15:55:49 +0300 |
commit | c0fdd1191c2908d30b71bc1ad5009d35a3ca6a4b (patch) | |
tree | de135b1e997829fafb4ed7f46fd4dceb30c1b3d0 /client | |
parent | 88830296392f64fe968625ef633a1277194f019b (diff) | |
download | vaadin-framework-c0fdd1191c2908d30b71bc1ad5009d35a3ca6a4b.tar.gz vaadin-framework-c0fdd1191c2908d30b71bc1ad5009d35a3ca6a4b.zip |
Prevent multiple runs of hierarchy column update (#9561)
Fixes #9555
Diffstat (limited to 'client')
-rw-r--r-- | client/src/main/java/com/vaadin/client/ui/treegrid/TreeGridConnector.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/treegrid/TreeGridConnector.java b/client/src/main/java/com/vaadin/client/ui/treegrid/TreeGridConnector.java index 48ba0562fd..c50da18e53 100644 --- a/client/src/main/java/com/vaadin/client/ui/treegrid/TreeGridConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/treegrid/TreeGridConnector.java @@ -77,6 +77,8 @@ public class TreeGridConnector extends GridConnector { private AwaitingRowsState awaitingRowsState = AwaitingRowsState.NONE; + private boolean hierarchyColumnUpdateScheduled = false; + @Override public TreeGrid getWidget() { return (TreeGrid) super.getWidget(); @@ -92,13 +94,16 @@ public class TreeGridConnector extends GridConnector { * between state change handling for the Grid and its columns. The renderer * of the column is set in a state change handler, and might not be * available when this method is executed. - * <p> - * TODO: This might need some clean up if we decide to allow setting a new - * renderer for hierarchy columns. */ @OnStateChange("hierarchyColumnId") void updateHierarchyColumn() { + if (hierarchyColumnUpdateScheduled) { + return; + } + Scheduler.get().scheduleFinally(() -> { + hierarchyColumnUpdateScheduled = false; + // Id of old hierarchy column String oldHierarchyColumnId = hierarchyColumnId; @@ -143,6 +148,7 @@ public class TreeGridConnector extends GridConnector { "Couldn't find column: " + newHierarchyColumnId); } }); + hierarchyColumnUpdateScheduled = true; } private HierarchyRenderer getHierarchyRenderer() { |