Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Problem with VIRTUAL TableViewer and selection
Problem with VIRTUAL TableViewer and selection [message #731982] Mon, 03 October 2011 15:36 Go to next message
Julien Saulou is currently offline Julien SaulouFriend
Messages: 10
Registered: October 2011
Junior Member
Hi,

Our application needs to display tables of several thousands items. For this reason, we're using SWT.VIRTUAL TableViewers. That works pretty well except for selection.

We're having two issues :

- Our tableviewers support sorting. When we use a virtual tableviewer, changing the selection does not preserve the current selected item but the row currently selected.
This leads to another item being selected.
Using a non virtual tableviewer, everything works fine.

- We're setting a Comparer on the tableviewers to implement our own hashcode() and equals() methods to compare the items based on their ids. When we remove an item from the tableviewer, the selection should be empty but the item that was below the deleted one gets selected despite our comparer indicating they're not equal.
Using a non virtual tableviewer, everything works fine.

We tried to go into debug and found out that the cache from the AbstractTableViewer.virtualManager seems to be up to date with the model.
Forcing the cache to be used in the AbstractTableViewer.virtualSetSelectionToWidget() seems to solve our problem.

If there is someone with a deep knowledge of the JFace Viewers, it would be nice to get some insight on these issues. Is this a bug or are we doing something wrong ?

Thanks fo the answers.

Julien
Re: Problem with VIRTUAL TableViewer and selection [message #731990 is a reply to message #731982] Mon, 03 October 2011 15:39 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Julien,
if your code works in RCP, but not in RAP, is't probably a bug in RAP.
In this case please file a bugzilla with a snippet to reproduce it.
Which version of RAP are you using?
Thanks,
Ivan

On 10/3/2011 6:36 PM, julien.saulou wrote:
> Hi,
>
> Our application needs to display tables of several thousands items.
> For this reason, we're using SWT.VIRTUAL TableViewers. That works
> pretty well except for selection.
>
> We're having two issues :
>
> - Our tableviewers support sorting. When we use a virtual tableviewer,
> changing the selection does not preserve the current selected item but
> the row currently selected.
> This leads to another item being selected.
> Using a non virtual tableviewer, everything works fine.
>
> - We're setting a Comparer on the tableviewers to implement our own
> hashcode() and equals() methods to compare the items based on their
> ids. When we remove an item from the tableviewer, the selection should
> be empty but the item that was below the deleted one gets selected
> despite our comparer indicating they're not equal.
> Using a non virtual tableviewer, everything works fine.
>
> We tried to go into debug and found out that the cache from the
> AbstractTableViewer.virtualManager seems to be up to date with the model.
> Forcing the cache to be used in the
> AbstractTableViewer.virtualSetSelectionToWidget() seems to solve our
> problem.
>
> If there is someone with a deep knowledge of the JFace Viewers, it
> would be nice to get some insight on these issues. Is this a bug or
> are we doing something wrong ?
>
> Thanks fo the answers.
>
> Julien
Re: Problem with VIRTUAL TableViewer and selection [message #732001 is a reply to message #731990] Mon, 03 October 2011 16:29 Go to previous messageGo to next message
Julien Saulou is currently offline Julien SaulouFriend
Messages: 10
Registered: October 2011
Junior Member
Hi Ivan,
Thanks for your quick answer.

We're using RAP 1.4.1.

I have no idea if it works with RCP since we do not use it.
One thing I can tell you is that I could reproduce the sorting issue with the org.eglipse.rap.demo project (Controls demo).
In the TableViewer tab, I checked VIRTUAL, added 300 items, selected one and then changed the sorting order. The selected element changed.

Hope it can help.

Julien
Re: Problem with VIRTUAL TableViewer and selection [message #732011 is a reply to message #732001] Mon, 03 October 2011 16:47 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Julien,
you description sounds to me like this bug:
338696: [Table] Virtual table sorting causes selection problems
https://bugs.eclipse.org/bugs/show_bug.cgi?id=338696
but it has been fixed in 1.4M7. If you still can reproduce it with
v1.4.1 please reopen the bug with a snippet/steps to reproduce it.
Thanks,
Ivan

On 10/3/2011 7:29 PM, julien.saulou wrote:
> Hi Ivan,
> Thanks for your quick answer.
>
> We're using RAP 1.4.1.
>
> I have no idea if it works with RCP since we do not use it.
> One thing I can tell you is that I could reproduce the sorting issue
> with the org.eglipse.rap.demo project (Controls demo).
> In the TableViewer tab, I checked VIRTUAL, added 300 items, selected
> one and then changed the sorting order. The selected element changed.
>
> Hope it can help.
>
> Julien
Re: Problem with VIRTUAL TableViewer and selection [message #732012 is a reply to message #732001] Mon, 03 October 2011 16:57 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Julien,
as I can reproduce it with RAP from CVS HEAD and Controls Demo ->
TableViewer tab I reopened the bug:
338696: [Table] Virtual table sorting causes selection problems
https://bugs.eclipse.org/bugs/show_bug.cgi?id=338696
Best,
Ivan

On 10/3/2011 7:29 PM, julien.saulou wrote:
> Hi Ivan,
> Thanks for your quick answer.
>
> We're using RAP 1.4.1.
>
> I have no idea if it works with RCP since we do not use it.
> One thing I can tell you is that I could reproduce the sorting issue
> with the org.eglipse.rap.demo project (Controls demo).
> In the TableViewer tab, I checked VIRTUAL, added 300 items, selected
> one and then changed the sorting order. The selected element changed.
>
> Hope it can help.
>
> Julien
Previous Topic:Last command not displayed in status bar
Next Topic:FileDialog - filter behavior not as expected
Goto Forum:
  


Current Time: Wed Apr 24 14:13:12 GMT 2024

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

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

Back to the top