Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Are VIRTUAL GridTableViewer supposed to work?
Are VIRTUAL GridTableViewer supposed to work? [message #1799520] Sat, 08 December 2018 09:48 Go to next message
Linuxhippy Mising name is currently offline Linuxhippy Mising nameFriend
Messages: 71
Registered: July 2009
Member
Hi,

I wonder - are virtual GridTableViewers supposed to work with RAP?
Virtual Tables work perfectly fine, however with GridTableViewers I haven't had much luck.

With the snippit I can observe the following behaviour:
* if the setMinSize call is commented out, I get the lazy-loading dots "..." as soon as I start scroling, but those are never resolved
* in case I make the call to setMinSize active, the GridTableViewer behaves actually non-virtual. All elements are loaded, with 10000 entries the browser tab is unresponsive.

	public void createContent(Composite parent) {
		final int INITIAL_INPUT_SIZE = 10000;
		
		ScrolledComposite comp = new ScrolledComposite(parent, SWT.VERTICAL);
		comp.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true));
		
		final GridTableViewer gridTableViewer = new GridTableViewer(comp, SWT.VIRTUAL);
		gridTableViewer.setContentProvider(ArrayContentProvider.getInstance());
		
		GridColumn gridColumn = new GridColumn(gridTableViewer.getGrid(), SWT.NONE);
		gridColumn.setWidth(200);
		
		final Object[] input = new Object[INITIAL_INPUT_SIZE];
		for(int item = 0; item < input.length; item++) {
			input[item] = "Item " + item;				
		}
		
		gridTableViewer.setInput(input);
		comp.setContent(gridTableViewer.getGrid());
		comp.setExpandHorizontal(true);
		comp.setExpandVertical(true);
		//comp.setMinSize(gridTableViewer.getGrid().computeSize(SWT.DEFAULT, SWT.DEFAULT));
	}
Re: Are VIRTUAL GridTableViewer supposed to work? [message #1799545 is a reply to message #1799520] Sun, 09 December 2018 20:04 Go to previous messageGo to next message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 221
Registered: February 2011
Senior Member
Not sure why the items aren't being resolved when it's virtual.

But if you tell the Grid to expand to the full size required to hold all it's input, it's going to load all the records as they're all visible.
Isn't that what's going to happen if you contain it in a scrollable composite? The scrollable composite will allow it's client to be as large as it want to be.
For a virtual table to work properly, the table need to manage its own scrolling. You should be giving it a SWT.V_SCROLL at least.
Re: Are VIRTUAL GridTableViewer supposed to work? [message #1800265 is a reply to message #1799545] Sat, 22 December 2018 10:21 Go to previous message
Linuxhippy Mising name is currently offline Linuxhippy Mising nameFriend
Messages: 71
Registered: July 2009
Member
Hi Chris,

> Not sure why the items aren't being resolved when it's virtual.
It seems when it is created without SWT.VERTICAL, scrolling is possible but items are not lazily loaded (instead the dots are displayed). This made me believe lazy-loading is somehow broken.

> For a virtual table to work properly, the table need to manage its own scrolling.
> You should be giving it a SWT.V_SCROLL at least.

Makes sense, now everything works as expected.

Thanks a lot, Clemens
Previous Topic:Mixing e3 and e4 in RAP?
Next Topic:How to Display Image in SWT TableColumn Sortable Column
Goto Forum:
  


Current Time: Tue Apr 16 23:55:15 GMT 2024

Powered by FUDForum. Page generated in 1.62527 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top