Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 368023 - After binding an TableRidget again, some data isn't showen or index errors occur.
Summary: After binding an TableRidget again, some data isn't showen or index errors oc...
Status: RESOLVED FIXED
Alias: None
Product: Riena
Classification: RT
Component: ridget (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Thorsten Schenkel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-06 07:29 EST by Sergei Jochim CLA
Modified: 2012-01-16 04:48 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergei Jochim CLA 2012-01-06 07:29:54 EST
In my case i created a new table with 3 columns and column formatters. After rebinding the table with 5 columns and column formatter with index > 3 an IndexOutOfBoundsException is thrown when the table with 5 columns is shown.
But after confirming all exceptions with "ok" the table is normally shown.

Maybe there is a problem with the TableViewer in this code in method bindUIControl:

// try to reuse the table viewer 
viewer = (AbstractTableViewer) control.getData(TABLE_VIEWER_DATA_KEY);
if ((viewer == null) || (viewer.getControl() != control)) {
        viewer = createTableViewer();
        control.setData(TABLE_VIEWER_DATA_KEY, viewer);
}

It seems, that the table viewer references some old data after reusing it.
Comment 1 Thorsten Schenkel CLA 2012-01-16 04:48:45 EST
Because of a windows bug the space of images (see java comment at the end of this comment) is still reserved after rebinding the TableRdiget and the SWT table.
This problem can be fixed by calling the method Table.removeAll during unbinding the UI control.

Comment in Table.setTableEmpty:
	   /*
		* Bug in Windows.  When LVM_SETIMAGELIST is used to remove the
		* image list by setting it to NULL, the item width and height
		* is not changed and space is reserved for icons despite the
		* fact that there are none.  The fix is to set the image list
		* to be very small before setting it to NULL.  This causes
		* Windows to reserve the smallest possible space when an image
		* list is removed.
		*/