SmartGWT: TreeGrid expand empty folder resets the tree

abc123

New Member
I am building a TreeGrid with data from an XML type DataSource, as in SmartClient showcase.I am using Windows XP and SmartGWT version 3.0, GWT SDK 2.4.0 (using Eclipse IDE).However, the problem is when I try to expand an empty folder, the tree closes itself/resets and resetting all selections made to none (since i'm using a checkbox tree selection type), and also I got this error(warning):\[code\][ERROR] [testtree] - 15:19:26.637:XRP0:WARN:ResultTree:isc_ResultTree_0 (created by: isc_TreeGrid_0):Adding node to tree with id property set to:1. A node with this ID is already present in this Tree - that node will be replaced. Note that this warning may be disabled by setting the reportCollisions attribute to false.\[/code\]This is actually very much alike with this (http://forums.smartclient.com/showthread.php?t=20167), however he does not explain the solution. :(This is the test values i use for the XML data source:\[code\]...<record><id>1</id><parentId>0</parentId><name>test1</name></record><record><id>2</id><parentId>1</parentId><name>test41</name></record><record><id>3</id><parentId>2</parentId><name>test2</name></record><record> <id>4</id> <parentId>3</parentId> <name>test212</name></record>\[/code\]This is the screenshot of the problem; (sorry not enough rep cannot post images)before I clicked the expand button: link (imgur image)and, after: linkAccording to the image above, this problem will occur if I try to expand \[code\]'test212'\[/code\], or \[code\]'test2'\[/code\].and this is the snippet of my TreeGrid properties:\[code\]...TreeGrid test = new TreeGrid();test.setAutoFetchData(true);test.setDataSource(SingletonDS.getInstance());test.setSelectionAppearance(SelectionAppearance.CHECKBOX);test.setShowPartialSelection(true);test.setShowSelectedStyle(false);layout.addMember(test);\[/code\]and this is the properties of my singleton DataSource:\[code\]... singleton.setDataFormat(DSDataFormat.XML);singleton.setID("singletonDS");DataSourceIntegerField idField = new DataSourceIntegerField("id", "ID");idField.setPrimaryKey(true);DataSourceIntegerField parentIdField = new DataSourceIntegerField("parentId", "Parent ID");parentIdField.setForeignKey(singleton.getID()+".id");parentId.setRootValue(0);DataSourceTextField nameField = new DataSourceTextField("name", "Name");singleton.setFields(idField, parentIdField, nameField);...\[/code\]Note: the XML data is already passed correctly into the grid.Thanks for your help! :)
 
Back
Top