smartgwt 3.0
Hi I am working on a treegrid which is loading data from a datasource.
Here is my definition of the datasource.
<DataSource ID="customDataSource_article"
serverConstructor="ArticleDataSource">
<fields>
<field name="id" title="id" type="text" primaryKey="true" />
<field name="parent_id" title="parent_id" type="text" required="true" foreignKey="id" rootValue="1" detail="true" />
<field name="title" title="title" type="text" length="40" required="true"/>
<field name="owner" type="text" length="128" required="true"/>
<field name="status" type="text" length="40" required="true"/>
</fields>
</DataSource>
In the datasource's executeFetch methods, it is calling sql and get a result set which contains both columns id and parent_id. It then passes the result to the client.
In client a treegrid is using the datasource. The tree is rendered.
However, when i clicked the leaf node, it will go back to the top node.
In my testing data, 8023 is the common parents to all other nodes. 8023 itself sets parent_id to 1, which doesnt exist in my result set.
Here is the results in the development console.
21:03:32.310 [ERROR] [webgui] 21:03:32.312:XRP1:WARN:ResultTree:isc_ResultTree_0 (created by: isc_TreeGrid_0):Adding node to tree with id property set to:8023. 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.
com.smartgwt.client.core.JsObject$SGWT_WARN: 21:03:32.312:XRP1:WARN:ResultTree:isc_ResultTree_0 (created by: isc_TreeGrid_0):Adding node to tree with id property set to:8023. 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.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:167)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
at java.lang.Thread.run(Thread.java:662)
I looked through all the treegrid samples in the showcase but still cannot figure out why expanding the leaf results in adding top record again.
What can I do to fix this issue?
Thanks
Hi I am working on a treegrid which is loading data from a datasource.
Here is my definition of the datasource.
<DataSource ID="customDataSource_article"
serverConstructor="ArticleDataSource">
<fields>
<field name="id" title="id" type="text" primaryKey="true" />
<field name="parent_id" title="parent_id" type="text" required="true" foreignKey="id" rootValue="1" detail="true" />
<field name="title" title="title" type="text" length="40" required="true"/>
<field name="owner" type="text" length="128" required="true"/>
<field name="status" type="text" length="40" required="true"/>
</fields>
</DataSource>
In the datasource's executeFetch methods, it is calling sql and get a result set which contains both columns id and parent_id. It then passes the result to the client.
In client a treegrid is using the datasource. The tree is rendered.
However, when i clicked the leaf node, it will go back to the top node.
In my testing data, 8023 is the common parents to all other nodes. 8023 itself sets parent_id to 1, which doesnt exist in my result set.
Here is the results in the development console.
21:03:32.310 [ERROR] [webgui] 21:03:32.312:XRP1:WARN:ResultTree:isc_ResultTree_0 (created by: isc_TreeGrid_0):Adding node to tree with id property set to:8023. 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.
com.smartgwt.client.core.JsObject$SGWT_WARN: 21:03:32.312:XRP1:WARN:ResultTree:isc_ResultTree_0 (created by: isc_TreeGrid_0):Adding node to tree with id property set to:8023. 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.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:167)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
at java.lang.Thread.run(Thread.java:662)
I looked through all the treegrid samples in the showcase but still cannot figure out why expanding the leaf results in adding top record again.
What can I do to fix this issue?
Thanks
Comment