0 Replies Latest reply on Apr 24, 2007 3:17 AM by .:lexx:.

    Feature request: TreeState and expandedNodes

      It will be perfect if developer can have access to expandedNodes Set in TreeState. This will help to restore expansion state after dynamic model change.

      Example:

       public void remove() {
       log.info("Remove");
       root.remove(0);
       rebuild();
       }
      
       private void rebuild() {
       uiRoot = builder.build(root);
       if (tree != null) {
       TreeState treeState = ((TreeState) tree.getComponentState());
       List<TreeRowKey> rowsToExpand = new ArrayList(treeState.getExpandedNodes());
      
       tree.resetDataModel();
      
       for (TreeRowKey key : rowsToExpand) {
       try {
       tree.queueNodeExpand(key);
       } catch (IOException e) {
       log.error("Error", e);
       }
       }
       }
       }