Hi,
I'm loading a DataBase from XML and want to add nodes later on. As long as such a Node is added as a child node to an existing node that works perfectly. However, if the Node should be a separate root node it does not appear.
A TreeGrid is used to display the DS.
There's no error or warning message I could provide...
Can anyone give me some help please?
Here's the DS:
and here the Add code that is called in the DS callback of the DS fetch operation:
Ekki
* GWT Rocks! * SmartGWT Rocks Even Harder! * SmartGWT PRO 2.0,
GWT 2.0, Jetty 7.0.0, Eclipse 3.5.1, JRE 1.6.0_16 *
For Evaluation only: MySQL 5.1.41, Connector/J 5.1.10
CI-CUBE.BIZ feat. CubeBrowser.AppSpot.com www.EasternGraphics.com/X-4GPL
I'm loading a DataBase from XML and want to add nodes later on. As long as such a Node is added as a child node to an existing node that works perfectly. However, if the Node should be a separate root node it does not appear.
A TreeGrid is used to display the DS.
There's no error or warning message I could provide...
Can anyone give me some help please?
Here's the DS:
Code:
class CatStructureDS extends DataSource { public static final String ID = "ID"; public static final String NAME = "Name"; public static final String LINK = "Link"; public static final String PARENT = "Parent"; public CatStructureDS(String pId) { setID(pId); setRecordXPath("/Catalogs/Catalog"); DataSourceTextField tIDField = new DataSourceTextField(ID, ID, 128); tIDField.setPrimaryKey(true); tIDField.setRequired(true); DataSourceTextField tNameField = new DataSourceTextField(NAME, NAME, 128); tNameField.setRequired(true); DataSourceTextField tLinkField = new DataSourceTextField(LINK, LINK, 128); DataSourceTextField tParentField = new DataSourceTextField(PARENT, PARENT, 128); tParentField.setForeignKey(pId+"."+ID); setFields(tIDField, tNameField, tLinkField, tParentField); setClientOnly(true); } }
Code:
Record tRecord = new Record(); tRecord.setAttribute(getCatalogServer().getCatAttribute(Server.CatAttribute.ID), "::search"); tRecord.setAttribute(getCatalogServer().getCatAttribute(Server.CatAttribute.LABEL), X4App.i18n(X4App.APP, "Search")); tRecord.setAttribute(getCatalogServer().getCatAttribute(Server.CatAttribute.PARENT), (String)null); pDS.addData(tRecord); tRecord = new Record(); tRecord.setAttribute(getCatalogServer().getCatAttribute(Server.CatAttribute.ID), "::bookmarks"); tRecord.setAttribute(getCatalogServer().getCatAttribute(Server.CatAttribute.LABEL), X4App.i18n(X4App.APP, "Bookmarks")); tRecord.setAttribute(getCatalogServer().getCatAttribute(Server.CatAttribute.PARENT), (String)null); pDS.addData(tRecord);
* GWT Rocks! * SmartGWT Rocks Even Harder! * SmartGWT PRO 2.0,
GWT 2.0, Jetty 7.0.0, Eclipse 3.5.1, JRE 1.6.0_16 *
For Evaluation only: MySQL 5.1.41, Connector/J 5.1.10
CI-CUBE.BIZ feat. CubeBrowser.AppSpot.com www.EasternGraphics.com/X-4GPL
Comment