Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » CheckboxTableViewer looses Checked State after Filter
CheckboxTableViewer looses Checked State after Filter [message #945473] Mon, 15 October 2012 12:11 Go to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 482
Registered: December 2010
Location: Germany
Senior Member
Hello

I have a CheckboxTableViewer which checkElements are bound to an EMF EList Property using JFace and EMF Databinding. This works great.

My problem started when I introduced a filter text field, so the user can filter the entries that are displayed in the table. This is implemented by adding a ViewerFilter to the table which filters the entries based on the filter text field input. The table is refreshed when the text in the filter text field changes. This in itself also works as expected.

Unfortunately, if an element is removed from the display by the filter and is then added again (because the filter text has been changed in a way to include the element again), the element looses it's checked state.

I think the problem might be caused, because the checked state is saved in the TreeItem widget which gets removed and later recreated when the filter changes.

My current thinking is that I will probably have to trigger an updateTargets on the DataBindingContext. I don't realy like this approach because the filter implementation does not know anything about the databinding, so it would be nice if I could solve this issue with the viewer api.

Does anyone have an idea of what I could try?

Thanks!
Christoph
Re: CheckboxTableViewer looses Checked State after Filter [message #1170100 is a reply to message #945473] Mon, 04 November 2013 12:06 Go to previous message
Robert K. is currently offline Robert K.Friend
Messages: 14
Registered: July 2009
Junior Member
Just for the records as ran into the same problem:

You need to specify a provider that saves the checked states via viewer.setCheckStateProvider(..).
For getting notified of the checkstate-changes you can register the provider as check-state-listener: viewer.addCheckStateListener(...) and update the internal state of the provider accordingly.
Afterwards your CheckboxTableViewer can be filtered without loosing the checked-states.
Previous Topic:ICelleditor: show error and do not allow to loose focus until valid data is inserted
Next Topic:TextAndDialogCellEditor
Goto Forum:
  


Current Time: Wed Apr 24 16:40:07 GMT 2024

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

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

Back to the top