Bug 100686 - Virtual Tables Not populating on Windows 2003 Server
Summary: Virtual Tables Not populating on Windows 2003 Server
Status: RESOLVED DUPLICATE of bug 95811
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows Server 2003
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-17 19:03 EDT by Phil Hunt CLA
Modified: 2005-06-20 16:59 EDT (History)
1 user (show)

See Also:


Attachments
Sample test dialog with TableViewer component (4.56 KB, text/java)
2005-06-17 19:06 EDT, Phil Hunt CLA
no flags Details
Corrected Sample Code (4.62 KB, text/java)
2005-06-20 15:11 EDT, Phil Hunt CLA
no flags Details
Version of your test class (4.58 KB, text/plain)
2005-06-20 15:59 EDT, Tod Creasey CLA
no flags Details
Example SWT code in an Action (1.53 KB, text/plain)
2005-06-20 16:43 EDT, Tod Creasey CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Phil Hunt CLA 2005-06-17 19:03:45 EDT
The TableViewer object is failing to display content defined by a 
contentprovider and labelprovider. Testing shows that label provider is not 
been called.

The problem is occuring for existing code that has been working under 3.0 and 
is no longer working in 3.1 RC2.

Sample code to follow.

I have not yet confirmed if the issue exists on other host operating systems.
Comment 1 Phil Hunt CLA 2005-06-17 19:06:58 EDT
Created attachment 23500 [details]
Sample test dialog with TableViewer component

This is a complete class which will reproduce the problem.
Comment 2 Tod Creasey CLA 2005-06-20 08:03:36 EDT
The problem is in your content provider.

When you call setInput you have the following code

tableViewer.setInput(cp.getList());

Your content provider has

public LinkedList getList() {
			return this.servers;
		}
		

servers is null initially. As a result if the input is null there is nothing we
can get elements from.

As a result getElements() never gets called as you started with a null input. 

If you change this line to

setInput(this)

you code works.

I ran this example in 3.0.2 as well and the behaviour was the same.
Comment 3 Phil Hunt CLA 2005-06-20 12:24:51 EDT
I will double-check.  I think I may have been too quick with the sample code.

Regards,

Phil
Comment 4 Phil Hunt CLA 2005-06-20 14:57:15 EDT
I located the issue.  It appears the meaning of SWT.VIRTUAL has changed. By 
removing SWT.VIRTUAL from the TableViewer constructor, my tables work fine.

I'm not sure if this would still be considered a bug.
Comment 5 Tod Creasey CLA 2005-06-20 14:58:39 EDT
It's changed in that we actually support it now <grin>... previously we created
everything - now we just create elements as they become visible.
Comment 6 Phil Hunt CLA 2005-06-20 15:05:54 EDT
Ok.

So the problem is then that somehow the sample code is not triggering 
TableViewer that new items are visible.

If you make the correction to the sample code you noted earlier, and 
add "SWT.VISIBLE" to the constructor you'll find that the content remains 
invisible.  :)

Phil
Comment 7 Tod Creasey CLA 2005-06-20 15:09:59 EDT
No - the problem is that your input was null so we were getting no elements.
This code doesn't work in 3.0 either.

All virtual does is fire your label providers when an entry becomes visible
rather than all at once.
Comment 8 Phil Hunt CLA 2005-06-20 15:11:40 EDT
Created attachment 23568 [details]
Corrected Sample Code

This corrected sample code still fails. The ContentProvider initialization
issue is corrected.
Comment 9 Tod Creasey CLA 2005-06-20 15:42:24 EDT
I think you attached an old file - this one is pretty much the same except for a
shifted import.
Comment 10 Phil Hunt CLA 2005-06-20 15:46:48 EDT
getList() has been changed to auto-initialize the content provider.

public LinkedList getList() {
  if (servers == null) getElements(null);
  return this.servers;
}

If you remove the SWT.VIRTUAL, the dialog displays correctly.  Adding 
SWT.VIRTUAL causes content not to display.  This shouldn't be the case if I 
understand correctly.
Comment 11 Tod Creasey CLA 2005-06-20 15:57:20 EDT
Thanks - I must have got the old version  somehow.

I cleaned yours up a bit to be a pure JFace app and on XP on RC3 it worked for me.

Let me attach my version and let me know if it works for you - it might be an
issue with the win 2003 server.
Comment 12 Tod Creasey CLA 2005-06-20 15:59:36 EDT
Created attachment 23570 [details]
Version of your test class

Your class with the GridLayout replaced by a swt GridLayout and import
com.octetstring.vde.config.adapters.LdapHost; removed from the imports
Comment 13 Phil Hunt CLA 2005-06-20 16:10:19 EDT
Thanks.  I ran your clean version of the test class. I get the same symptoms as 
before.

FWIW...I'm testing on RC2.  I will get the latest and re-confirm RC3.

At this point, it appears that Windows 2003 Server doesn't work, while XP does.
Comment 14 Tod Creasey CLA 2005-06-20 16:14:44 EDT
OK thanks Phil - I suspected a wierd VIRTUAL issue.

Updating and moving to SWT.

SWT please see my version of the example which is running on XP.
Comment 15 Tod Creasey CLA 2005-06-20 16:42:57 EDT
I have confirmed that this is an issue on Windows 2003 and not XP.

The problem is that we are not getting the SetData callback and so our label 
provider never gets called.

I will attach an example action
Comment 16 Tod Creasey CLA 2005-06-20 16:43:26 EDT
Created attachment 23572 [details]
Example SWT code in an Action
Comment 17 Tod Creasey CLA 2005-06-20 16:47:37 EDT
Note that my example is missing setItemCount which when added does work on Win 
2003
Comment 18 Tod Creasey CLA 2005-06-20 16:59:14 EDT
This is not an SWT issue at all. I can replicate this on Windows XP on 2003.

The issue is with setting item counts. If you want to use a VIRTUAL table the
item count must be set. 

You need a line something like 

tableViewer.setInput(cp.getList());
tableViewer.setItemCount(cp.getList().size());

when you create the table viewer or the table has no idea how many items in
needs to callabck for.

In 3.0 we didn't support VIRTUAL so we created all of the TableItems for you -
what you had was a non VIRTUAL table in that case.

In 3.1 we are properly virtual but we need you to set the item count.

This is really a dupe of 95811.

*** This bug has been marked as a duplicate of 95811 ***