During development we began noticing this following warning:
It confused us for a while, until I finally tracked it down to what looks to be a bug in CanvasItem.js. Check out the following method in it:
The apparent bug is the canvas._setTabIndex(index, false); line -- I think it should be passing true and not false. That second argument indicates the tab indexes should be auto-allocated, and passing false indicates that the tab index is being user-set. The problem arises because SmartGWT segregates tab indices between user-allocated (1-999) and auto-allocated (1000+) and throws warnings if a user-allocated tab index is >=1000. _setCanvasTabIndex above is called automatically and is passed an auto-allocated, > 999 index, and so when it tries to set the index of its wrapped canvas as a > 999 user-allocated index, the warning occurs.
Does that all make sense? I believe the problem exists in both SmartClient 8.2 and 8.3. The way I've found to reproduce that warning is to create a form with a CanvasItem that contains a listGrid in which createRecordComponent is overridden. I've attached a simple SmartGWT project that replicates those conditions -- just run it and resize the grid to a large size to see the warnings pop up.
Code:
[ERROR] [helloworld] - 16:13:14.599:MUP7:WARN:GridBody:isc_MyListGrid_0_body:setTabIndex(): Passed index of 1259. This method does not support setting a tab index greater than 999. Setting tab index for this widget to 999
[a]MathFunction.getStackTrace(_1=>undef, _2=>undef, _3=>undef, _4=>undef, _5=>undef)
Canvas.setTabIndex(_1=>1259)
ListGrid.updateMemberTabIndex(_1=>[GridBody ID:isc_MyListGrid_0_body])
Canvas.addChild(_1=>[Canvas ID:isc_Canvas_4], _2=>undef, _3=>undef)
GridRenderer.addEmbeddedComponent(_1=>[Canvas ID:isc_Canvas_4], _2=>Obj, _3=>3, _4=>undef, _5=>"expand", undef, undef, undef)
[a]MathFunction.invokeSuper(_1=>[Class GridBody], _2=>"addEmbeddedComponent", _3=>[Canvas ID:isc_Canvas_4], _4=>Obj, _5=>3, _6=>undef, _7=>"expand", _8=>undef, _9=>undef, _10=>undef)
GridBody.addEmbeddedComponent(_1=>[Canvas ID:isc_Canvas_4], _2=>Obj, _3=>3, _4=>undef, _5=>"expand")
ListGrid.$81v(_1=>Obj, _2=>null, _3=>[GridBody ID:isc_MyListGrid_0_body], _4=>3, _5=>undef)
ListGrid.updateRecordComponents()
GridBody.redraw(_1=>"Layout getting new size", _2=>undef, _3=>undef, _4=>undef)
Layout.resizeMembers(_1=>Array[2], _2=>Array[2], _3=>false)
Layout.layoutChildren(_1=>"resized", _2=>0, _3=>539)
ListGrid.layoutChildren(_1=>"resized", _2=>0, _3=>539)
Canvas.$t1(_1=>undef)
Canvas.resizeBy(_1=>0, _2=>539, _3=>undef, _4=>undef, _5=>undef)
Canvas.resizeTo(_1=>396, _2=>577, _3=>undef, _4=>undef, _5=>undef)
CanvasItem.$602(_1=>396, _2=>577)
CanvasItem.sizeCanvas(_1=>undef)
CanvasItem.getElementHTML(_1=>"Germany", "Germany")
FormItem.$15r(_1=>"Germany", _2=>true, _3=>true)
FormItem.getInnerHTML(_1=>"Germany", _2=>true, _3=>true, _4=>undef)
DynamicForm.getInnerHTML()
Canvas.$px(_1=>undef)
Canvas.$p9()
Canvas.$ra()
Canvas.redraw(_1=>"setPageRect")
** recursed on [a]MathFunction.invokeSuper
Code:
_setCanvasTabIndex : function (index) {
//this.logWarn(this.name + " setCanvasTabIndex running - index:" + index);
var canvas = this.canvas,
widgets = [];
if (canvas) this._getCanvasTabDescendents(canvas, widgets);
for (var i = 0; i < widgets.length; i++) {
canvas = widgets[i];
// clears any pointers to prev/next in auto-tab-order
canvas._removeFromAutoTabOrder();
// use the internal method so we don't hit the user-specified tabIndex ceiling
//this.logWarn("assigning:" + index + " to " + canvas);
canvas._setTabIndex(index, false);
// increment
index += canvas == this.canvas ? 1 : canvas.getTabIndexSpan();
}
},
Does that all make sense? I believe the problem exists in both SmartClient 8.2 and 8.3. The way I've found to reproduce that warning is to create a form with a CanvasItem that contains a listGrid in which createRecordComponent is overridden. I've attached a simple SmartGWT project that replicates those conditions -- just run it and resize the grid to a large size to see the warnings pop up.
Comment