2 Replies Latest reply on May 15, 2015 7:48 AM by gurusathish

    Rich faces rich:tree get selected path

    gurusathish

      I am developing jsf application using richfaces component library

      Now i am customizing and using the rich:tree . I want to get the selected TreeNode path .....

      I tried of converting UITree to JTree but failed......

       

      public void selectionChanged(TreeSelectionChangeEvent selectionChangeEvent) {

      String fulPath = null;

        try{

                     JTtree  jTree= (JTtree ) selectionChangeEvent.getSource();

                    fulPath  = jTree.getSelectionPath(); /*************This is what i want to get *************/

         

           }catch(Exception ex){

                                   log.warn("Exception occured in Folder Selection Changed of PTController.selectionChanged() "+ex);

         

          }

      }

       

      How to get the selected path from rich:tree please help me ...........Thanks in advance

        • 1. Re: Rich faces rich:tree get selected path
          michpetrov

          You'll have to implement that yourself, the tree doesn't keep track of it - it can't know what properties the node objects have. I am not familiar with JTree, where does it get the path from?

          • 2. Re: Rich faces rich:tree get selected path
            gurusathish

            Thank you for your fast reply

             

            public class SubFolder  implements TreeNode {

                private TreeNode parent;

                private Integer parentId;

                private Integer nodeId;

                private String type;

                private String name;

            }

             

            this is the object (TreeNode) i am using. Is there any possibility of converting the Event object into this TreeNode to get the TreePath?