You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by siddharth sriramka <si...@in.com> on 2014/07/17 15:40:36 UTC

Tree Component : problem facing while adding child node data at runtime

Hello, I am a beginner for using Tapestry framework. I need some help on Tree Component. Problem Statement:1. I need to implement a Tree which contains 2 different Objects(P,C) for Parent and Child Nodes[P:C > 1:n relationship].2. On first render, we only load P objects and populate only parent nodes(without any child nodes). [THIS DATA IS AVAILABLE PRIOR TO RENDERING THE TREE].3. After the Tree is rendered, User Clicks on Expand(+) button, we should fetch the C objects from DB and populate the child node of the clicked Parent Node. 4. THE CALL TO DB SHOULD BE ONLY ONCE IF USER HAS CLICKED TO EXPAND THE PARENT NODE AND FETCH THE CHILD NODE DATA.” I have taken reference from http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/treefromdatabasewithzones and implemented the functionality in similar manner. I am able to render the tree and display all Parent nodes. When I try to add data to child nodes I have the data but I am not able to modify the existing tree mode
 l. I am actually trying to override the functionality in Tree.java of Tapestry source code to achieve this in below method. Object onExpandChildren(String nodeId){TreeNode container = model.getById(nodeId);expansionModel.markExpanded(container);return new RenderNodes(container.getChildren());} Based on the NodeId passed to this method, I am able to fetch the list of C Objects at the start of this method. I am not able to know where shall i try to modify and add content to tree?Please guide me on this. Any thoughts ? Thanks in AdvanceSiddDear userssubscribe ! Get Yourself a cool, short @in.com Email ID now! Dear users! Get Yourself a cool, short @in.com Email ID now!