3 Replies Latest reply on May 28, 2009 5:03 AM by nbelaevski

    Problem with tree upgrading from 3.2.1.GA to 3.3.1.GA

    shipmaster

      Hi everyone,

      I have a changeExpandListener as follows:

      @SuppressWarnings("unchecked")
       public void changeExpandListener(NodeExpandedEvent evt) {
      
       TreeState state = (TreeState) ((UITree) evt.getComponent())
       .getComponentState();
       NST node = (NST) ((UITree) evt.getComponent()).getRowData();
       TreeRowKey key = (TreeRowKey) ((UITree) evt.getComponent()).getRowKey();
       log.debug("Row key is {}", key);
       if (state.isExpanded(key)) {
       log.debug("Adding node to expanded");
       if (!expandedNodes.contains(node))
       expandedNodes.add(node);
       } else {
       log.debug("removing node from expanded");
       expandedNodes.remove(node);
       }
      
       }
      


      This was working in 3.2.1.GA, the log output for it was
      11:08:16,306 INFO [STDOUT] 11:08:16.306 [http-127.0.0.1-8080-4] DEBUG c.o.t.NestedSetTreeEditorController - Row key is j__id4:0:j__id4:0
      11:08:16,307 INFO [STDOUT] 11:08:16.307 [http-127.0.0.1-8080-4] DEBUG c.o.t.NestedSetTreeEditorController - removing node from expanded
      


      When I upgraded to 3.3.1.GA, the output became

      11:13:05,717 INFO [STDOUT] 11:13:05.717 [http-127.0.0.1-8080-4] DEBUG c.o.t.NestedSetTreeEditorController - Row key is j__id4:0:j__id4:0
      11:13:05,717 INFO [STDOUT] 11:13:05.717 [http-127.0.0.1-8080-4] DEBUG c.o.t.NestedSetTreeEditorController - Adding node to expanded
      


      So TreeState.isExpanded(key) always returns true for me now, is there a workaround or a different way I should be detecting node state?

      Thanks.