2 Replies Latest reply on Feb 12, 2011 12:40 AM by veerendra

    Dynamic Tree with context menu Example

    veerendra

      Hi,

       

      I need to develop a dynamic tree with context menu (add a node, edit a node, delete a node).
      Please point me to some tree example with context menu.

       

      I have searched in google for it. I didn't get any right one.

       

      I am using NetBeans 6.9.1, RichFaces 3.3.3, GlassFish 3.0.1 and Hibernate

       

      Thank you

        • 1. Dynamic Tree with context menu Example
          mp911de

          Hi Veerendra,

          in your first Post you actually add Nodes dynamically:

           

                         TreeNodeImpl nodeImpl = new TreeNodeImpl();

                          nodeImpl.setData(value);

                          node.addChild(new Integer(counter), nodeImpl);

           

          If you add in an action a TreeNodeImpl to your parent or remove a Child from a Parent node, you're done with your Task. If you use AJAX for add/remove, make sure the tree's ID is in the reRender-Property of your a4j Component.

           

          Best regards,

          Mark

          • 2. Dynamic Tree with context menu Example
            veerendra

            Hi Mark,

             

            Thank you for the reply. I am looking for implementation of context menu for tree node. In the example I am using properties file to construct the tree. But, I need to form the tree with data from Database using Hibernate. If any examples are there, Please let me know.

             

             

             

            Regards,

            Veerendra