Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 434987

Summary: [Table] TableItems may be empty when filtering on a virtual table
Product: [RT] RAP Reporter: Wolfgang Pedot <wolfgang.pedot>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.3   
Target Milestone: 2.3 RC1   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Wolfgang Pedot CLA 2014-05-15 12:15:32 EDT
I have a few virtual tables with columns and a text-filter in my application. As long as some items match the filter everything works ok but once all items have gone because of the filter strange things start to happen. When I delete the filter-text character by character I can see items coming back because of the alternating background-colors but they do not have any images or labels in them. Once I click one item or scroll the viewer vertically they appear again, also typing in a new filter-text with a match can fix things.

I am able to reproduce the problem in the controls-demo (TableViewer-Tab) if I create the TableViewer with (getStyle() | SWT.VIRTUAL) flags. Maybe the filter is disabled in case of VIRTUAL flag here because of that but filters used to work with virtual tables before. Tests have been done with current 2.3 git master.

Looking at the javascript it appears the items get deconstructed when the are not visible and then get constructed again when they should come back. However they never receive any texts until they are clicked or scrolled.

Is this expected behaviour?
Comment 1 Ivan Furnadjiev CLA 2014-05-15 12:58:02 EDT
Is it reproducible with RAP 2.2 release or 2.3M1/M2? Could you provide a complete self-running snippet/project to demonstrate the issue? Does it work in RCP?
Comment 2 Wolfgang Pedot CLA 2014-05-15 13:33:51 EDT
I am getting the same result with 2.2.0.20131204, have not tested in RCP yet.

All you need to do is change the first line of TableViewerTab.createViewer in the controls demo to 

viewer = new TableViewer(parent, getStyle() | SWT.VIRTUAL);

then launch the application and for example type "adan" in the filter-text of the TableViewer-tab. Afterwards delete the text and the items should "appear" without labels until you click on one.

I will also test with a small RCP application.
Comment 3 Wolfgang Pedot CLA 2014-05-15 13:51:50 EDT
I just transplanted the relevant parts into an RCP demo project with a single view using Kepler SR1 and I do not have the issue there.
Comment 4 Ivan Furnadjiev CLA 2014-05-15 14:05:47 EDT
I can reproduce it and I have a fix (call redraw() at the end of Table#setItemCount()). Will push a gerrit change tomorrow.
Comment 5 Wolfgang Pedot CLA 2014-05-15 14:45:41 EDT
Works for me as well.
Comment 6 Ivan Furnadjiev CLA 2014-05-16 02:37:01 EDT
Pending change - https://git.eclipse.org/r/26697.
Comment 7 Ivan Furnadjiev CLA 2014-05-19 06:20:57 EDT
Change is merged to master.