PDA

View Full Version : Grid View Refresh - gwt core error



jonas sabu
4 Apr 2011, 6:19 AM
Hi all,

I am using a TreeGrid with a Grid View that i wanted to refresh every time i change a row. To do that i found the GridView.refresh() method that does exactly what i want. Only problem is when i do the refresh with any tree node parent expanded, next time I try to collapse that parent by double clicking it it gives this error:

ERROR: Uncaught exception escaped. com.google.gwt.core.client.JavaScriptException: (TypeError): this.insertBefore is not a function
fileName: http://127.0.0.1:8888
lineNumber: 26
stack: ([object HTMLImageElement],[object HTMLImageElement])@http://127.0.0.1:8888:26
@:0
(null,14614558,[object MouseEvent],[object HTMLDivElement],[object GWTJavaObject])@http://127.0.0.1:8888/harvesterui/hosted.html?harvesterui:56
([object MouseEvent])@http://127.0.0.1:8888:157
((function (evt) {var listener, curElem = this;while (curElem && !(listener = curElem.__listener)) {curElem = curElem.parentNode;}if (curElem && curElem.nodeType != 1) {curElem = null;}if (listener) {if (__gwt_makeJavaInvoke(1)(null, 14549025, listener)) {__gwt_makeJavaInvoke(3)(null, 14614558, evt, curElem, listener);}}}),[object HTMLDivElement],[object Object])@http://127.0.0.1:8888:29
@:0
(null,65563,(function (evt) {var listener, curElem = this;while (curElem && !(listener = curElem.__listener)) {curElem = curElem.parentNode;}if (curElem && curElem.nodeType != 1) {curElem = null;}if (listener) {if (__gwt_makeJavaInvoke(1)(null, 14549025, listener)) {__gwt_makeJavaInvoke(3)(null, 14614558, evt, curElem, listener);}}}),[object HTMLDivElement],[object Object])@http://127.0.0.1:8888/harvesterui/hosted.html?harvesterui:56
([object MouseEvent])@http://127.0.0.1:8888:41

at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:195)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:188)
at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
at com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1669)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
at java.lang.Thread.run(Thread.java:619)
ERROR: Uncaught exception escaped. com.google.gwt.core.client.JavaScriptException: (TypeError): this.insertBefore is not a function
fileName: http://127.0.0.1:8888
lineNumber: 26
stack: ([object HTMLImageElement],[object HTMLImageElement])@http://127.0.0.1:8888:26
@:0
(null,14614558,[object MouseEvent],[object HTMLDivElement],[object GWTJavaObject])@http://127.0.0.1:8888/harvesterui/hosted.html?harvesterui:56
([object MouseEvent])@http://127.0.0.1:8888:157
((function (evt) {var listener, curElem = this;while (curElem && !(listener = curElem.__listener)) {curElem = curElem.parentNode;}if (curElem && curElem.nodeType != 1) {curElem = null;}if (listener) {if (__gwt_makeJavaInvoke(1)(null, 14549025, listener)) {__gwt_makeJavaInvoke(3)(null, 14614558, evt, curElem, listener);}}}),[object HTMLDivElement],[object Object])@http://127.0.0.1:8888:29
@:0
(null,65563,(function (evt) {var listener, curElem = this;while (curElem && !(listener = curElem.__listener)) {curElem = curElem.parentNode;}if (curElem && curElem.nodeType != 1) {curElem = null;}if (listener) {if (__gwt_makeJavaInvoke(1)(null, 14549025, listener)) {__gwt_makeJavaInvoke(3)(null, 14614558, evt, curElem, listener);}}}),[object HTMLDivElement],[object Object])@http://127.0.0.1:8888/harvesterui/hosted.html?harvesterui:56
([object MouseEvent])@http://127.0.0.1:8888:41

at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:195)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:188)
at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
at com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1669)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
at java.lang.Thread.run(Thread.java:619)

And it doesnt change the arrow in the selected row to expand:
25474

Thanks in advance hope anyone can help me. I'm running ext gwt 2.2.0.

micgala
26 Apr 2011, 4:33 AM
Are you still facing problems?

I'm seeing something similar within my own code sometimes.

mikedonovan
27 Apr 2011, 4:36 PM
i have existing code and am using gxt 2.2.3 today.

i found that with treegrid and all default selection models on a expanded tree:

1. i expand, collapse a node by clicking on the icon for coll/exp
2. i then click on the icon to expand again
3. it doesnt change
4. i double click and it still stays the same icon, however expansion occurs
5. i doulbe click to collapse and i get that exception you have

NOTE: the row isnt selected on the 1st expand/collapse. but on the next expand the row becomes selected and its like when i click on the expand icon it doesnt expand, however the row selected

i use gridview refresh after the model is available as i calculate heights and ask for a refresh after setting dimensions. used to work in the old gxt code.

any ideas ?

jonas sabu
30 Apr 2011, 12:40 PM
I still have the same problem :( don't know how to solve this... a workaround would be cool

sven
1 May 2011, 1:32 AM
Can anybody please post a fully working testcase implementing entrypoint for this? Or can somebody give me the steps to reproduce this here: http://www.sencha.com/examples/#basictreegrid

jonas sabu
1 May 2011, 8:49 AM
Ok i made a simple test and got that error again, here it is:

TreeStore<ModelData> store = new TreeStore<ModelData>();
TreeGrid<ModelData> tree = new TreeGrid<ModelData>(store, cm);

BaseTreeModel n1 = new BaseTreeModel();
n1.set("name","num1");
BaseTreeModel n11 = new BaseTreeModel();
n11.set("name","num11");
n1.add(n11);

BaseTreeModel n2 = new BaseTreeModel();
n2.set("name","num2");

BaseTreeModel n3 = new BaseTreeModel();
n3.set("name","num3");
BaseTreeModel n33 = new BaseTreeModel();
n33.set("name","num33");
n3.add(n33);

store.add(n1,true);
store.add(n2,true);
store.add(n3,true);

Then when i click a button on the UI, i Dispatch.get().dispatch(EVENT_XXX);

That EVENT_XXX does the following:
tree.getView().refresh(true);

After that the same error reported here occurs.

sven
1 May 2011, 9:13 AM
That is a already known issue. I will report back here once that is fixed in SVN.


UPDATE:

This is already fixed in SVN now

tomasz.lewandowski
2 Sep 2011, 4:55 AM
I have the same problem using gxt 2.2.4. Should the problem be already fixed in 2.2.4 ?