Unable to retrieve index in model from selection [message #1219013] |
Fri, 29 November 2013 15:42 |
|
Hello,
I've implemented a NatTable with GroupBy, Filter and Sorting capabilities. All work greats. But when I register on RowSelectionEvents (with a RowSelectionProvider) I'm unable to retrieve the position of the selection in my underlying model from the selected row index.
Example :
With no filter applied, if I select the row 0, it corresponds to the item 0 in my model.
But if I activate some filter and I select the row 0, the corresponding item in my model is not 0 but, maybe, the item 149.
So I'm trying to convert the position 0 in my selection layer to the correct index in my model.
I've tried :
LayerUtil.convertRowPosition(selectionLayer, rowPosition, bodyDataLayer)
selectionLayer.localToUnderlyingRowPosition(rowPosition) but it doesn't give me the good result. I think I'm doing something wrong and that someone can give me some piece of solution
Regards,
Alain
|
|
|
|
Re: Unable to retrieve index in model from selection [message #1219496 is a reply to message #1219032] |
Wed, 04 December 2013 09:17 |
|
Thank you for your reply. I didn't realize that the NatTable index was the FilterList index.
But in fact, the problem was that the filterList.get(index) returned me the wrong object because I worked on an outdated FilterList: I'm in an Eclipse editor and the model must be refreshed at each time the source file is modified. My update strategy was not a good one for the FilterList and the NatTable therefore worked on an outdated list. I resolved that by refreshing directly the underlying EventList which transmits properly the update to the SortedList and then to the FilterList.
|
|
|
Powered by
FUDForum. Page generated in 0.03235 seconds