Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » [databinding] virtual table, sorting & data binding problems
[databinding] virtual table, sorting & data binding problems [message #795170] Fri, 10 February 2012 06:37 Go to next message
Nikolay Kasyanov is currently offline Nikolay KasyanovFriend
Messages: 30
Registered: September 2010
Location: Russia
Member
Hi,

I'm faced following problem using jface data binding for table viewer (SWT.VIRTUAL) with sorting: when some of model fields updated (from outside or by inline table editor), table viewer should resort of course, so I added listener to ObservableMapCellLabelProvider, it calls TableViewer.update with appropriate args.

So the problem is that changed item duplicated in table, hiding one of the others table rows. Here is example:
before change:
http://d.pr/nVnp+
after change:
http://d.pr/oQ3k+

After resorting table another time by hand (using table column click) everything is ok. I've found this problem using EMF data binding initially, but I created simple test project with bean databinding, and here is the same problem.

Test project here (with all needed jars): http://d.pr/r4sR

Source code: https://gist.github.com/1787145
Re: [databinding] virtual table, sorting & data binding problems [message #795187 is a reply to message #795170] Fri, 10 February 2012 07:03 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
I guess it is jface bug - please file a bugzilla.

Tom

Am 10.02.12 07:37, schrieb Nikolay Kasyanov:
> Hi,
>
> I'm faced following problem using jface data binding for table viewer
> (SWT.VIRTUAL) with sorting: when some of model fields updated (from
> outside or by inline table editor), table viewer should resort of
> course, so I added listener to ObservableMapCellLabelProvider, it calls
> TableViewer.update with appropriate args.
>
> So the problem is that changed item duplicated in table, hiding one of
> the others table rows. Here is example:
> before change:
>
> after change:
>
>
> After resorting table another time by hand (using table column click)
> everything is ok. I've found this problem using EMF data binding
> initially, but I created simple test project with bean databinding, and
> here is the same problem.
>
> Test project here (with all needed jars): http://d.pr/r4sR
>
> Source code: https://gist.github.com/1787145
Re: [databinding] virtual table, sorting & data binding problems [message #795193 is a reply to message #795187] Fri, 10 February 2012 07:12 Go to previous message
Nikolay Kasyanov is currently offline Nikolay KasyanovFriend
Messages: 30
Registered: September 2010
Location: Russia
Member
Hi, Tom, thanks for quick reply.

I found interesting solution: instead of adding listener to label provider i've overridden TableViewer's handleLabelProviderChanged to call update with appropriate properties array, and everything is ok.

So I think default handleLabelProviderChange messed table up in some way (I think so because ViewerColumn's label provider listener called to it right after my custom label provider listener called update).

Going to file bug.

[Updated on: Fri, 10 February 2012 07:15]

Report message to a moderator

Previous Topic:TreeViewer Sorter
Next Topic:Data Binding
Goto Forum:
  


Current Time: Fri Dec 19 08:53:46 GMT 2014

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

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