Hi,
I someone could look into this (I am struggling with it for a while).
This is a very simple TreeGrid example with titleField set in the DataSource:
If testTreeGrid.setFields(versionField) is commented out then I got such view:
which uses titleField correctly as pointed too the versionField.
But if testTreeGrid.setFields(versionField) is processed then I got such output:
This time there is no Name at all and id's are displayed instead of version column values.
The only difference is that I am defining TreeGridField just to set some properties for it.
Thanks for any help / explanation.
MichalG
ps SmartGWT svn 1307, GWT 2.0.4
I someone could look into this (I am struggling with it for a while).
This is a very simple TreeGrid example with titleField set in the DataSource:
Code:
package org.yournamehere.client; import com.google.gwt.core.client.EntryPoint; import com.smartgwt.client.widgets.tree.TreeGrid; import com.smartgwt.client.widgets.tree.TreeGridField; public class MainEntryPoint implements EntryPoint { public void onModuleLoad() { TreeGrid testTreeGrid = new TreeGrid(); testTreeGrid.setWidth(300); testTreeGrid.setHeight(100); testTreeGrid.setAutoFetchData(true); testTreeGrid.setDataSource(TestDS.getInstance()); testTreeGrid.setUseAllDataSourceFields(true); TreeGridField versionField = new TreeGridField("version"); // testTreeGrid.setFields(versionField); testTreeGrid.draw(); } }
Code:
package org.yournamehere.client; import com.smartgwt.client.data.RestDataSource; import com.smartgwt.client.data.fields.DataSourceIntegerField; public class TestDS extends RestDataSource { private static TestDS instance = null; public static TestDS getInstance() { if (instance == null) { instance = new TestDS("Umowa"); } return instance; } public TestDS(String id) { setID(id); setDataURL("response.xml"); setTitleField("version"); DataSourceIntegerField idField = new DataSourceIntegerField("id", "ID"); idField.setPrimaryKey(true); DataSourceIntegerField versionField = new DataSourceIntegerField("version", "Version"); DataSourceIntegerField aneksField = new DataSourceIntegerField("aneks", "Aneks"); aneksField.setForeignKey("Umowa.id"); aneksField.setHidden(true); setFields(idField, versionField, aneksField); } }
Code:
<response> <status>STATUS_SUCCESS</status> <startRow>0</startRow> <endRow>2</endRow> <totalRows>2</totalRows> <data> <Umowa> <id>393216</id> <version>59</version> <nrUmowy>123/8</nrUmowy> </Umowa> <Umowa> <id>458752</id> <version>6</version> <nrUmowy>123/9</nrUmowy> <aneks>393216</aneks> </Umowa> </data> </response>
which uses titleField correctly as pointed too the versionField.
But if testTreeGrid.setFields(versionField) is processed then I got such output:
This time there is no Name at all and id's are displayed instead of version column values.
The only difference is that I am defining TreeGridField just to set some properties for it.
Thanks for any help / explanation.
MichalG
ps SmartGWT svn 1307, GWT 2.0.4
Comment