Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Unable to perform selection when row is added or removed from event list
Unable to perform selection when row is added or removed from event list [message #1208793] Mon, 25 November 2013 07:19 Go to next message
SD Khan is currently offline SD KhanFriend
Messages: 63
Registered: May 2013
Member
Hi Dirk !

I am trying to select the row , after adding it in a event list but it get refreshed.

On investigating the problem i found, whenever there has been change in the event list (row add/remove) then the whole stack of layers get refreshed including selection layer so my selection gets also refreshed.

I have tried several different things like performing selection in a separate thread after adding the row but so far not successful to find some generic solution.

Is there any way through which i can control or restrict layer refresh?


All i want is to perform some selection after add/remove/update in the event list.

Re: Unable to perform selection when row is added or removed from event list [message #1208856 is a reply to message #1208793] Mon, 25 November 2013 07:58 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2751
Registered: July 2012
Senior Member
That is one of those architecture issues. As long as an item in the NatTable can not be identified, this will always be some sort of issue.

The issue is dependent on SelectionLayerStructuralChangeEventHandler which simply clears the selection on refreshes.

You could implement a different handler and register it against the SelectionLayer that is more intelligent and checks if the selection has really changed or if it is valid from the structural point. I thought I posted something like a PreserveSelectionLayerStructuralChangeEventHandler a while ago. Not sure what side effects might occur. Need to be tested well.

You could also try if adding a listener to the NatTable helps that executes the selection after the list change processing is done.
Re: Unable to perform selection when row is added or removed from event list [message #1209022 is a reply to message #1208856] Mon, 25 November 2013 09:47 Go to previous messageGo to next message
SD Khan is currently offline SD KhanFriend
Messages: 63
Registered: May 2013
Member
Yup,right. I got there as you identified during debugging the nattable code. I think implementing and registering my own handler will be good.

Thanks,
Safdar Khan

Re: Unable to perform selection when row is added or removed from event list [message #1209275 is a reply to message #1209022] Mon, 25 November 2013 12:30 Go to previous messageGo to next message
SD Khan is currently offline SD KhanFriend
Messages: 63
Registered: May 2013
Member
Hi,

i have checked your implemented class
"PreserveSelectionLayerStructuralChangeEventHandler" it work when change in the event list occurs, i.e keep the selection but now does not clear or move selection accordingly when rows are sorted.

Regards,
Safdar Khan
Re: Unable to perform selection when row is added or removed from event list [message #1209300 is a reply to message #1209275] Mon, 25 November 2013 12:42 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2751
Registered: July 2012
Senior Member
As I said before

Quote:
Not sure what side effects might occur.


If you have row id's you could implement something that remembers the selected rows via id and reapply or skip clearing. Otherwise it will get complicated.

That's why we will address this in the future architecture. If you find another solution in the current architecture, feel free to contribute.
Previous Topic:Cell editor issue
Next Topic:Traverse in filter row with tab key
Goto Forum:
  


Current Time: Fri Dec 06 16:07:57 GMT 2019

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

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

Back to the top