Bug 451084 - [JFace] TableViewer doesnt update existing content if filter is active
Summary: [JFace] TableViewer doesnt update existing content if filter is active
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-12 03:03 EST by Fabian Miehe CLA
Modified: 2020-03-17 03:03 EDT (History)
3 users (show)

See Also:


Attachments
example implementation (5.96 KB, text/x-java)
2014-11-12 03:03 EST, Fabian Miehe CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Miehe CLA 2014-11-12 03:03:45 EST
Created attachment 248595 [details]
example implementation

The tableviewer doesnt update elements if a filter is active and the content of the viewer is changing.

i.e.
1) add element (integer value 1) -> element is visible
2) Activate filter (filter all elments % 2 != 0)
3) element is invisible
4) change element value to 2
5) element is still invisble, but should be visible
Comment 1 Lars Vogel CLA 2014-11-12 03:31:32 EST
From the example you posted I see that you call update() in between 4.) and 5.). Does refresh() work correctly?
Comment 2 Fabian Miehe CLA 2014-11-12 04:16:48 EST
yes refresh works, but if the filter is still active the item is filtered again if it is invalid.
So you have to call update() and afterthat refresh().

...
tableViewer.update(new Object[]{model}, properties);
tableViewer.refresh();
...

I thought, refresh() reloads the complete model and we just wanna update one or more columns.(performance?)
Comment 3 Lars Vogel CLA 2014-11-12 04:25:30 EST
(In reply to Fabian Miehe from comment #2)
> I thought, refresh() reloads the complete model and we just wanna update one
> or more columns.(performance?)

Correct, I just wanted to know if refresh works. Please create a Gerrit review for the fix in TableViewer.update
Comment 4 Lars Vogel CLA 2015-01-22 18:57:38 EST
(In reply to Lars Vogel from comment #3)
> (In reply to Fabian Miehe from comment #2)
> > I thought, refresh() reloads the complete model and we just wanna update one
> > or more columns.(performance?)
> 
> Correct, I just wanted to know if refresh works. Please create a Gerrit
> review for the fix in TableViewer.update

Any update here Fabian?
Comment 5 Lars Vogel CLA 2015-02-26 18:14:08 EST
I think I misunderstood the example. The viewer can not model the content of the viewer, for this you would need to use data binding.
Comment 6 Fabian Miehe CLA 2015-02-27 03:26:49 EST
The model is the same, but if a single property value inside the model is changed, the filter doesnt work.

The ViewerFilter recognizes add or remove (Structural Changes), but if a single property in a existing table row changes the filter doesnt work.

So you have to remove and then add a table row, if the content of an exitisting row is changed.

If you always have to filter inside the model(this is possible), the ViewerFilter is useless (for us :-) ).

We use a lot of tables with dynmanic content.

e.g. if you have aircraft data, the latitude and longitude values change frequently, but the name of the aircraft is still the same. 
So it is only neccessary to update the lat or lon value not the whole table row.
Comment 7 Lars Vogel CLA 2015-02-27 08:15:07 EST
Fabian, I think I misunderstood your case. Reopening, I agree this sounds like a bug. Are you planning to provide a patch?
Comment 8 Eclipse Genie CLA 2015-03-09 07:57:47 EDT
New Gerrit change created: https://git.eclipse.org/r/43406
Comment 9 Fabian Miehe CLA 2015-03-09 07:59:22 EDT
I changed the update method inside the TableViewer.
But maybe i would be better to change the update method inside the base class ColumnViewer
Comment 10 Lars Vogel CLA 2015-05-06 13:22:06 EDT
Sorry Fabian, we try to integrate that into early 4.6.
Comment 11 Lars Vogel CLA 2016-04-25 15:16:58 EDT
Mass move to 4.7.
Comment 12 Eclipse Genie CLA 2020-03-17 03:03:20 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.