0 Replies Latest reply on Nov 9, 2007 10:15 AM by Peter Brewer

    rich:tree programmatic expand through api only

    Peter Brewer Novice

      Hi, I'm currently using the following function to expand to a particular node (using Seam 2GA and richfaces 3.1.2GA):

       private void expandPathList(List<Integer> expansionPath) {
       UITree treeComponent = RichUtil.getTreeFromView() ;
      
       if (treeComponent != null) {
       List<Integer> incrementalPath = new ArrayList<Integer> () ;
       try {
       // need to expand each level of the tree explicitly
       // see http://www.jboss.com/index.html?module=bb&op=viewtopic&t=112799&postdays=0&postorder=asc&start=10
      
       for (Integer nodeId : expansionPath) {
       incrementalPath.add(nodeId) ;
       treeComponent.queueNodeExpand(new ListRowKey(incrementalPath)) ;
       }
       } catch (IOException e) {
       log.error("Cannot queue node expansion for path: #0", e, incrementalPath) ;
       }
       } else {
       log.debug("Cannot find tree component in the view - it may not be in the component tree yet?") ;
       }
       }
      


      This does work very well, however, I would like to remove the reference to org.richfaces.component.UITree so that I can separate the jsf libraries from my application libraries in my deployed ear file.

      Is there anyway to achieve this functionality without referencing the UITree implementation class? ANy hints or suggestions would be greatly appreciated.

      Thanks in advance,

      Peter