Hi,
I am trying to read an XML file and create a tree in GWT-Ext. Code to
implement the same has been taken from GWT-Ext showcase demo. Problem
is: code successfully creates a tree with child nodes but I could not
find a way to create tree with sub sub child. Code only generates node
upto a single level. Also I am interested in reading "name" attribute
of each XML element. Please suggest what do I do?
My set up has:
• Windows XP SP2
• Eclipse 3.4
• GWT-Ext v-2.0.5
• Ext -2.0.2
• GWT 1.5.3
• Cypal Studio plug-in
• JDK 6
______________________________________________________________________________________________
family.xml which needs to be read :
______________________________________________________________________________________________
<mainfolder>
<parent name="p1">
<child1 name="c1">
<subchild1 name="subc1">
<subsubchild1 name="subsubc1">
</subsubchild1>
</subchild1>
</child1>
<child2 name="c1"></child2>
</parent>
<parent name="p2">
<child1 name="c1">
<subchild1 name="subc1">
<subsubchild1 name="subsubc1">
</subsubchild1>
</subchild1>
</child1>
<child2 name="c2"></child2>
</parent>
</mainfolder>
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
The GWT code snippet
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
Panel navPanel = new Panel();
navPanel.setTitle("List Of TestPlans");
navPanel.setBorder(false);
final TreePanel treePanel = new TreePanel();
treePanel.setTitle("---Test Plans Hierarchy---");
treePanel.setAnimate(true);
treePanel.setEnableDD(true);
treePanel.setContainerScroll(true);
treePanel.setRootVisible(true);
treePanel.setWidth(200);
treePanel.setHeight(200);
treePanel.setSelectionModel(new MultiSelectionModel());
final XMLTreeLoader loader = new XMLTreeLoader();
loader.setDataUrl("family.xml");
loader.setMethod(Connection.GET);
loader.setRootTag("mainfolder");
loader.setFolderTag("parent");
loader.setFolderTitleMapping("@name");
loader.setLeafTag("child1");
loader.setLeafTitleMapping("@name");
loader.setLeafTag("child2");
loader.setLeafTitleMapping("@name");
loader.setQtipMapping("@qtip");
loader.setIconMapping("@icon");
AsyncTreeNode root = new AsyncTreeNode("List Of
TestPlans", loader);
treePanel.setRootNode(root);
root.expand();
treePanel.expandAll();
navPanel.add(treePanel);
westPanel.add(navPanel);
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---