PDA

View Full Version : tree issue


ravindran
07-20-2007, 07:06 AM
Hi
I would like to load the Tree component with data generated by a servlet.
Instead of loading the xml at compile-time, I set the source of the dataset to my servlet like this:

<dataset request="true" name="ancestors" src="http://localhost:8080/CategoryServlet" />


My Tree is defined as:
<tree datapath="ancestors:/" icon="null" showroot="false">
<tree datapath="*" icon="null" text="$path{'@name'}" isleaf="$path{'@grandparent'}"/>
</tree>

The problem is that when I set the src of the dataset to my servlet, only the root node is displayed ("Frodo" in this example). Is it possible to initialize the tree after the xml has been received

senshi
07-20-2007, 08:25 AM
Is it possible to initialize the tree after the xml has been received

Yes, through "initstage='defer'":

<view initstage="defer" >

<handler name="ondata" reference="mydataset" >
//the dataset is now fully loaded, so we can create our tree...
this.completeInstantiation();
</handler>

<tree>
...
</tree>
</view>