| Summary: | [TableViewer] Javascript error in IE8 | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Oliver B. <oliver> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P2 | CC: | ivan, tbuschto |
| Version: | 2.2 | ||
| Target Milestone: | 2.3 M3 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Oliver B.
I can't reproduce it, but I'm only emulating IE8 in IE11.
Here is what the response text that apparently crashes the client looks like:
{"head":{"requestCounter":6},"operations":[["destroy","w234"],["set","w104",{"itemCount":0,"itemMetrics":[[0,0,50,0,0,0,0],[1,50,50,0,0,0,0],[2,100,140,0,0,0,0],[3,240,180,0,0,0,0],[4,420,50,0,0,0,0],[5,470,50,0,0,0,0]]}]]}
Destroy the last item, set grid item count to 0. Nothing special.
Just form the error message I suspect Grid._updateScrollHeight, line:
var itemsOffsetHeight = this.getRootItem().getOffsetHeight();
But the only way getRooItem() should ever return null (or something else than an item) is if the Grid has been disposed, so I don't get how this could ever happen.
Ivan, if you can reproduce this, can you check if this already existed in older RAP versions?
(In reply to Tim Buschtoens from comment #1) > Ivan, if you can reproduce this, can you check if this already existed in > older RAP versions? It's reproducible for me with online nightly Examples demo and real IE8 in VM with WinXP. Will check older version and report. It crashes with RAP 2.0 too:
Could not process server response:
Error: 'this.getRootItem()' is null or not an object
Script: {
"head": {
"requestCounter": 8
},
"operations": [ [ "destroy", "w144" ], [ "set", "w135", {
"itemCount": 0,
"itemMetrics": [ [ 0, 0, 50, 0, 0, 0, 0 ], [ 1, 50, 50, 0, 0, 0, 0 ], [ 2, 100, 140, 0, 0, 0, 0 ], [ 3, 240, 180, 0, 0, 0, 0 ], [ 4, 420, 50, 0, 0, 0, 0 ], [ 5, 470, 50, 0, 0, 0, 0 ] ],
"focusItem": null
} ] ]
}
name: TypeError
message: 'this.getRootItem()' is null or not an object
number: -2146823281
description: 'this.getRootItem()' is null or not an object
Debug: on
Request: {"head":{"requestCounter":7},"operations":[["set","w134",{"selectionStart":4,"selectionLength":0,"text":"hela"}],["set","w1",{"cursorLocation":[360,260]}],["notify","w134","Modify",{}]]}
Phase: 5
This error comes from GridItem.js#getDefaultHeight where GridItem#getRootItem returns null. It seems that in IE8 GridItem.js#getDefaultHeight is called after the item is disposed. This issue is really weird. I've managed to trace it to the method from where the difference between IE8 and other browsers come - GridItem#getChild. Under some specific circumstances IE return an object (GridItem) when element from *empty* array is requested. Some logging from GridItem#getChild: console.log( "GridItem#getChild index: " + index ); // 0 console.log( "GridItem#getChild children.length: " + this._children.length ); // 0 console.log( "GridItem#getChild children[ index ]: " + this._children[ index ] ); // *not* undefined console.log( "GridItem#getChild is: " + this._children[ index ].classname ); // rwt.widgets.GridItem console.log( "GridItem#getChild is disposed: " + this._children[ index ].isDisposed() ); // true Fixed with change https://git.eclipse.org/r/24831. |