Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326941 - [Table] js-error "item is undefined" when setting visibility false
Summary: [Table] js-error "item is undefined" when setting visibility false
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.4   Edit
Hardware: All All
: P1 normal (vote)
Target Milestone: 1.4 M6   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: sr132
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-04 12:13 EDT by Tim Buschtoens CLA
Modified: 2011-03-01 06:49 EST (History)
2 users (show)

See Also:


Attachments
snippet (1.61 KB, application/octet-stream)
2010-10-04 12:13 EDT, Tim Buschtoens CLA
no flags Details
proposed fix (794 bytes, patch)
2010-10-04 12:20 EDT, Tim Buschtoens CLA
no flags Details | Diff
Another fix (2.42 KB, patch)
2011-02-21 10:14 EST, Ivan Furnadjiev CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Buschtoens CLA 2010-10-04 12:13:13 EDT
Created attachment 180181 [details]
snippet

To reproduce:
- Run attached snippet
- double click an table-item
Comment 1 Tim Buschtoens CLA 2010-10-04 12:19:13 EDT
- TableRow gets over state by mouse
- Items are disposed by the response-code
- table visibility is set to false by response-code
- as a result, widget._beforeDisappear removes the rows over state.
- table tries to re-render the item formerly associated with the TableRow
-> Crash
- Table.updateRows would update the associations between TableRows and TableItems, but is called too late. (See TableLCAUtil.writeItemMetrics).
Comment 2 Tim Buschtoens CLA 2010-10-04 12:20:56 EDT
Created attachment 180182 [details]
proposed fix
Comment 3 Ralf Sternberg CLA 2010-10-05 06:41:17 EDT
The patch has been applied to the 1.3 maintenance branch, it will be part of the 1.3.2 service release.
Comment 4 Ivan Furnadjiev CLA 2011-02-21 10:14:38 EST
Created attachment 189415 [details]
Another fix

When the TableItem is disposed, the Table.js#_removeItem is called, but the internal property _itemCount left unchanged. Thus, for a short period if time we have out of sync between the actual TableItem instances and the internal property _itemCount. One possible solution could be to decrement the _itemCount and update the rows in Table.js#_removeItem, but in case, disposing of multiple items will trigger the _updateRows multiple times, which will make the performance worse. The attached patch writes itemCount in the first position in TableLCA#renderChanges, ensuring that the sequential write operations will work on updated _itemCount property.
Comment 5 Tim Buschtoens CLA 2011-03-01 06:49:12 EST
Applied ivans patch to CVS HEAD.
Its the better patch because its solves the cause of the problem instead of fighting the symptoms.