Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Row Selection(Row Selection)
Row Selection [message #988775] Mon, 03 December 2012 01:05 Go to next message
Francine Mising name is currently offline Francine Mising name
Messages: 14
Registered: July 2009
Junior Member
This is probably a simple problem but my NatTable is not highlighting selected row when I click on the row header. I also want to enable multi-row selection. What am I missing.
Re: Row Selection [message #988784 is a reply to message #988775] Mon, 03 December 2012 02:46 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1214
Registered: July 2012
Senior Member
How did you instantiate the SelectionLayer? It sounds like an issue with the row header layer dependency.
Re: Row Selection [message #988924 is a reply to message #988784] Mon, 03 December 2012 14:08 Go to previous messageGo to next message
Francine Mising name is currently offline Francine Mising name
Messages: 14
Registered: July 2009
Junior Member
I am creating my own GlazedList where each row is a HistoryItem:

EventList<HistoryItem> eventList = GlazedLists.eventList(model.getHistoryList());
FilterList<HistoryItem> filterList = new FilterList<HistoryItem>(eventList);
SortedList<HistoryItem> sortedList = new SortedList<HistoryItem> (filterList, null);

IColumnPropertyAccessor<HistoryItem> columnPropertyAccessor = new
ReflectiveColumnPropertyAccessor<HistoryItem>(propertyNames);

ListDataProvider<HistoryItem> bodyDataProvider = new ListDataProvider<HistoryItem>
(sortedList, columnPropertyAccessor);
DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
GlazedListsEventLayer<HistoryItem> glazedListsEventLayer = new
GlazedListsEventLayer<HistoryItem>(bodyDataLayer, eventList);
DefaultBodyLayerStack bodyLayerStack = new
DefaultBodyLayerStack(glazedListsEventLayer);
SelectionLayer selectionLayer = bodyLayerStack.getSelectionLayer();

...
Here is my RowHeaderLayer:
IDataProvider rowHeaderDataProvider = new
DefaultRowHeaderDataProvider(bodyDataProvider);
IUniqueIndexLayer rowHeaderDataLayer = new
DefaultRowHeaderDataLayer(rowHeaderDataProvider);
RowHeaderLayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer,
bodyDataLayer, selectionLayer);

Thanks for your help,
Re: Row Selection [message #989008 is a reply to message #988924] Tue, 04 December 2012 05:04 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1214
Registered: July 2012
Senior Member
Well this looks reasonable. At least the parts you posted. If it doesn't work, than maybe you forgot to link your layers correctly to the GridLayer you are using?

Have a look at the DefaultGridLayer. There the init method does the similar thing you are trying to do. Maybe it is just a typo in setting the references.
Re: Row Selection [message #989161 is a reply to message #989008] Tue, 04 December 2012 17:40 Go to previous message
Francine Mising name is currently offline Francine Mising name
Messages: 14
Registered: July 2009
Junior Member
Thanks for the reply. I finally had to start over and got it to work. I guess I had a bad reference as you suggested.
Previous Topic:table displaying jdbc resultset
Next Topic:Using FilterList for tree in NatTable
Goto Forum:
  


Current Time: Fri Jul 25 23:15:05 EDT 2014

Powered by FUDForum. Page generated in 0.01571 seconds