PDA

View Full Version : [1.2.3] Row is not inserted in a Grid



sdc
12 Mar 2009, 8:36 AM
Hosted mode / Windows XP (IE6)

No issue in web mode with Firefox 3.

I am trying to add a model to an empty GridStore. I get a JavaScriptException at Element.getElementsByTagName which is called by a GridView method :

public Element getCell(int row, int col) {
return getRow(row).getElementsByTagName("td").getItem(col);
}
Actually, when I use Eclipse debugger, I see that row and col are equals to 0 and that getRow(row) returns null (don't know why a NullPointerException is not thrown).
It looks like the GridView.insertRows didn't insert the row ?



[ERROR] Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: (TypeError)
at com.google.gwt.dom.client.Element$.getElementsByTagName$(Native Method)
at com.extjs.gxt.ui.client.widget.grid.GridView.getCell(GridView.java:329)
at com.extjs.gxt.ui.client.widget.grid.GridView.ensureVisible(GridView.java:757)
at com.extjs.gxt.ui.client.widget.grid.GridView.focusCell(GridView.java:294)
at com.extjs.gxt.ui.client.widget.grid.GridView.focusRow(GridView.java:309)
at com.extjs.gxt.ui.client.widget.grid.GridView.insertRows(GridView.java:1196)
at com.extjs.gxt.ui.client.widget.grid.GridView.onAdd(GridView.java:1200)
at com.extjs.gxt.ui.client.widget.grid.GridView$5.storeAdd(GridView.java:1079)
at com.extjs.gxt.ui.client.store.StoreListener.handleEvent(StoreListener.java:21)
at com.extjs.gxt.ui.client.store.StoreListener.handleEvent(StoreListener.java:1)
at com.extjs.gxt.ui.client.event.BaseObservable.fireEvent(BaseObservable.java:74)
at com.extjs.gxt.ui.client.store.ListStore.insert(ListStore.java:439)
at com.extjs.gxt.ui.client.store.ListStore.insert(ListStore.java:262)
at com.extjs.gxt.ui.client.store.ListStore.insert(ListStore.java:275)
at com.extjs.gxt.ui.client.store.ListStore.add(ListStore.java:156)

sven
12 Mar 2009, 8:39 AM
You need to post your code that is demonstrating the issue. Please read the bugforum guidlines.

sdc
12 Mar 2009, 8:45 AM
Yeah I know that but it would take me about one day to reduce the code to a few lines, stripping all the code I cannot publicly post.
The stack trace cannot help ?

sven
12 Mar 2009, 8:47 AM
XML grid example is empty and rows are added after you click the load button. And it works great. So it is also possible that it is something within your code.

sdc
12 Mar 2009, 9:59 AM
XML grid example is empty and rows are added after you click the load button. And it works great. So it is also possible that it is something within your code.

Something in my code would cause issue in IE6 and not in Firefox /:) ?
By the way, this is not the first time I encounter such issue : http://extjs.com/forum/showthread.php?t=55806
I am almost certain this is a bug in IE6 (or maybe GWT) and I hope it can be workarounded.
But for now I definitely cannot spend so much time in debugging IE6 or GWT, so if you have no idea, forget it. Don't know what I'm going to do ...

EDIT : I had no issue 2 days ago, so I have looked into my SVN history to see the changes for the last two days. The only thing I've done related to this grid is to add the final keyword on some method parameters in a bean.
I've just removed them... CRAZY it is working now 8-|. I can't believe how it (IE6 javascript engine ?) is fragile and this is really worrying. I don't understand the issue. Do final keywords exist in Javascript ? Is GWT compiler just stripping these keywords ?
Well, I guess the best thing to do now is to see if I can restrict my application to other browsers than IE6... :s

sven
12 Mar 2009, 10:03 AM
I will try to reproduce it but that will be hard. Glad that you figured it out what it broke for you.

sdc
12 Mar 2009, 10:08 AM
I will try to reproduce it but that will be hard.

I guess it will. By the way, in the other thread, I'm not sure I was using final keywords.


Glad that you figured it out what it broke for you.

Thanks. Me too :)

sdc
13 Mar 2009, 8:01 AM
To let you know, the exception message is :"Object doesn't support this property or method" but I guess it won't help (of course a null object has no property or method...)

wangyugod
20 Jul 2009, 4:09 AM
I also encountered this problem, any suggestion? It occurred when the grid rows changed from 3 rows to 2 rows ( or from 2 rows to 1row), is it a bug of GWT?

monzonj
28 Jul 2009, 5:29 AM
Final variables are not serialized by GWT. This is well documented by Google.

It's a common error to have a "final Set" (or array), fill it with values in the server and then serialize it to the client... the values will be lost during the serialization.

sdc
2 Aug 2009, 11:42 PM
This is not a serialization issue, it doesn't occur in a RPC, it is a a javascript error.