Hello,
this post will be a possible bug report for "ComboxboxItem" and "SelectItem" when they are used with a Datasource set by method "setOptionDataSource".
Version
- Smartgwt: 2.5 (also with 2.3, 2.4)
- SmartClient Version: SC_SNAPSHOT-2011-09-06/LGPL
- Browser: IE 8/9, FF7+, Chrome16 (I used chrome with it's dev tools for debugging)
I fixed the javascript error occured by modified the file "/com/smartclient/public/sc/modules/ISC_Forms.js" at line 2075 (see below), but this solution remove a part of process, it could cause possible side effects at others time.
instead of
the javascript error :
Smartclient Developer Console :
Now the context and how this error happened, if that could help you any logic in this error.
I wrote an heavy application who used POJO with lazy-loading on the client side (server side made with spring2.5/hibernate...).
The client side is build with a tabset, the error is throw after 8 opening and closing of a tab with hudge contents inside, this tab contains a stacksection (6 sections in) and each sections is different (have combobox, selectItems, treegrids, uploading form...).
Ok well the error now, during the 9 opening of this screen just the tab is drawn, not the panel add to the tab. The canvas is created (I test with the method "canvas.isCreated()") but it can't drawn (the method canvas.isDrawn() put in a timer with repeating set to 500ms never return true).
I checked the DOM with chrome dev tools and all elements are here with a "top:-9999px" set until the Vlayout containing the "SelectItem" and his associated "DataSource"; this layout and after aren't in the DOM.
So I changed the javascript like I sayed before but I'm not sure that's the right answer. The involved component still be the "DataSource" of a "SelectItem", I say "the DataSource" because I tested without "DataSource" there's no errors and also just without not loading data in DataSource and the error happened.
Just one more thing (no it's not the Iphone 5), the main cause seems to be a memory problem because when I remove this section the error also occured (on another section with selectItem inside), but later (can do 16 open/close of this tab), the time of loading tab also increased after each drawn. I take a snapshot of browser memory with chrome tools, and I saw the datasource who generated the error aren't destroyed on tab close. There is 9 DS in memory corresponding to the selectItem one different for each opening, others DS related to treegrid or others components are correctly destroyed.
I'll try to destroy manually this datasource on close but not worked.
I know that's a strange bug, and a possible result of how my application was wrote but if you have any ideas, I'll take it. You could join me by email for more informations, I done many tests before changed the js.
Thanks.
this post will be a possible bug report for "ComboxboxItem" and "SelectItem" when they are used with a Datasource set by method "setOptionDataSource".
Version
- Smartgwt: 2.5 (also with 2.3, 2.4)
- SmartClient Version: SC_SNAPSHOT-2011-09-06/LGPL
- Browser: IE 8/9, FF7+, Chrome16 (I used chrome with it's dev tools for debugging)
I fixed the javascript error occured by modified the file "/com/smartclient/public/sc/modules/ISC_Forms.js" at line 2075 (see below), but this solution remove a part of process, it could cause possible side effects at others time.
Code:
if(_4){isc.PickListMenu.$512-=1;var _9=_4.$51v; var _6=_2[_9.getDataSource().getID()]; if (_6!=undefined) _6.remove(_4);
Code:
if(_4){isc.PickListMenu.$512-=1;var _9=_4.$51v; var _6=_2[_9.getDataSource().getID()]; _6.remove(_4);
the javascript error :
Code:
2012-02-06 19:25:24,188 [FATAL] Uncaught JavaScript exception [Uncaught TypeError: Cannot call method 'remove' of undefined] in http://localhost:5900/Gali/gali/sc/modules/ISC_Forms.js, line 2075
Code:
18:03:03.567:TMR6:WARN:Log:TypeError: Cannot call method 'remove' of undefined unnamed() @ storeSharedPickList() @ gali/sc/modules/ISC_Forms.js:2075:89 <anonymous>() @ gali/sc/modules/ISC_Forms.js:2068:387 SelectItem.makePickList() @ gali/sc/modules/ISC_Forms.js:2177:59 fetchData() @ gali/sc/modules/ISC_Forms.js:2065:71 SelectItem.drawn() @ gali/sc/modules/ISC_Forms.js:2138:151 DynamicForm._itemsDrawn() @ gali/sc/modules/ISC_Forms.js:438:129 DynamicForm.draw() @ gali/sc/modules/ISC_Forms.js:427:181 Layout.layoutChildren() @ gali/sc/modules/ISC_Foundation.js:439:179 Layout.drawChildren() @ gali/sc/modules/ISC_Foundation.js:341:100 Canvas.draw() @ gali/sc/modules/ISC_Core.js:2052:247
Now the context and how this error happened, if that could help you any logic in this error.
I wrote an heavy application who used POJO with lazy-loading on the client side (server side made with spring2.5/hibernate...).
The client side is build with a tabset, the error is throw after 8 opening and closing of a tab with hudge contents inside, this tab contains a stacksection (6 sections in) and each sections is different (have combobox, selectItems, treegrids, uploading form...).
Ok well the error now, during the 9 opening of this screen just the tab is drawn, not the panel add to the tab. The canvas is created (I test with the method "canvas.isCreated()") but it can't drawn (the method canvas.isDrawn() put in a timer with repeating set to 500ms never return true).
I checked the DOM with chrome dev tools and all elements are here with a "top:-9999px" set until the Vlayout containing the "SelectItem" and his associated "DataSource"; this layout and after aren't in the DOM.
So I changed the javascript like I sayed before but I'm not sure that's the right answer. The involved component still be the "DataSource" of a "SelectItem", I say "the DataSource" because I tested without "DataSource" there's no errors and also just without not loading data in DataSource and the error happened.
Just one more thing (no it's not the Iphone 5), the main cause seems to be a memory problem because when I remove this section the error also occured (on another section with selectItem inside), but later (can do 16 open/close of this tab), the time of loading tab also increased after each drawn. I take a snapshot of browser memory with chrome tools, and I saw the datasource who generated the error aren't destroyed on tab close. There is 9 DS in memory corresponding to the selectItem one different for each opening, others DS related to treegrid or others components are correctly destroyed.
I'll try to destroy manually this datasource on close but not worked.
I know that's a strange bug, and a possible result of how my application was wrote but if you have any ideas, I'll take it. You could join me by email for more informations, I done many tests before changed the js.
Thanks.
Comment