diff options
author | Aleksi Hietanen <aleksi@vaadin.com> | 2017-05-02 10:58:29 +0300 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-05-02 10:58:29 +0300 |
commit | 60db37dfaaa7d04bb393a27b888110dc73299404 (patch) | |
tree | cbf72dc7dd7be193aa091a17936ffb2e6675e06d /shared | |
parent | f8921dc387a572b12ac7c9c6f4677e5a1d0e5b70 (diff) | |
download | vaadin-framework-60db37dfaaa7d04bb393a27b888110dc73299404.tar.gz vaadin-framework-60db37dfaaa7d04bb393a27b888110dc73299404.zip |
Improve expand and collapse of items in TreeGrid (#9159)
Fixes a race condition when expanding multiple items.
Only one expand or collapse request should be sent from
the client before waiting for a response, otherwise the
indexing in subsequent requests will be incorrect.
Adds API to collapse and expand multiple items from the
server, reducing the amount of round trips with multiple
item expands and collapses.
HierarchyMapper now correctly keeps expanded nodes expanded
if their parent is collapsed.
Diffstat (limited to 'shared')
-rw-r--r-- | shared/src/main/java/com/vaadin/shared/ui/treegrid/TreeGridClientRpc.java | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/shared/src/main/java/com/vaadin/shared/ui/treegrid/TreeGridClientRpc.java b/shared/src/main/java/com/vaadin/shared/ui/treegrid/TreeGridClientRpc.java index 16d2179741..d6d7d95def 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/treegrid/TreeGridClientRpc.java +++ b/shared/src/main/java/com/vaadin/shared/ui/treegrid/TreeGridClientRpc.java @@ -15,6 +15,8 @@ */ package com.vaadin.shared.ui.treegrid; +import java.util.List; + import com.vaadin.shared.communication.ClientRpc; /** @@ -26,22 +28,22 @@ import com.vaadin.shared.communication.ClientRpc; public interface TreeGridClientRpc extends ClientRpc { /** - * Inform the client that an item with the given key has been expanded by - * the server. + * Inform the client that a list of items with the given keys have been + * expanded by the server. * - * @param key - * the communication key of the expanded item + * @param keys + * the communication keys of the expanded items */ - public void setExpanded(String key); + public void setExpanded(List<String> keys); /** - * Inform the client that an item with the given key has been collapsed by - * the server. + * Inform the client that a list of items with the given keys have been + * collapsed by the server. * - * @param key - * the communication key of the collapsed item + * @param keys + * the communication keys of the collapsed items */ - public void setCollapsed(String key); + public void setCollapsed(List<String> keys); /** * Clear all pending expands from the client. |