我是GWT GWT-EXT的新手,我模仿它的演示 问题是我应该把 xml 文件
放在哪里final TreePanel treePanel = new TreePanel() {
{
setAnimate(true);
setEnableDD(true);
setContainerScroll(true);
setRootVisible(true);
}
};
final XMLTreeLoader loader = new XMLTreeLoader() {
{
setDataUrl("countries-cb.xml");
setMethod("get");
setRootTag("countries");
setFolderIdMapping("@id");
setLeafIdMapping("@id");
setFolderTitleMapping("@title");
setFolderTag("team");
setLeafTitleMapping("@title");
setLeafTag("country");
setQtipMapping("@qtip");
setDisabledMapping("@disabled");
setCheckedMapping("@checked");
setIconMapping("@icon");
setAttributeMappings(new String[]{"@rank"});
}
};
AsyncTreeNode root = new AsyncTreeNode("Countries", loader);
treePanel.setRootNode(root);
treePanel.render();
root.expand();
treePanel.expandAll();
答案 0 :(得分:0)
setDataUrl获取XML数据源的URL参数。
也许你仍然坚持“如何提供XML文件”?
答案 1 :(得分:0)
我把它放在 projectName/war/projectName/xmlfile.xml
下,效果很好。