Skip to main content



      Home
Home » Eclipse Projects » NatTable » nattable is not getting updated on adding the data to eventlist
nattable is not getting updated on adding the data to eventlist [message #1713769] Fri, 06 November 2015 09:59 Go to next message
Eclipse UserFriend
Hi
i have 2 nattables in a dialog . second table gets populated based on the selection in first table. i am updating the glazedlist of 2nd table in the listener and refreshing the table,but its not working .


EventList<secondTableData> data = GlazedLists.eventList(new ArrayList<secondTableData>());
firstTable.addLayerListener( new ILayerListener()
{
@Override
public void handleLayerEvent( ILayerEvent event )
{
if( event instanceof RowSelectionEvent )
{
final RowSelectionEvent rowEvent = ( RowSelectionEvent ) event;
int rowIndx = partTable.getRowIndexByPosition( rowEvent.getRowPositionToMoveIntoViewport() );
firstTableData = firstTableDataprovider.getRowObject(rowIndx);
//create data for add it to the glazedlist

data.add(object);
secTable.refresh();
}
}

} );

Re: nattable is not getting updated on adding the data to eventlist [message #1713775 is a reply to message #1713769] Fri, 06 November 2015 10:29 Go to previous messageGo to next message
Eclipse UserFriend
Typically this is a list reference problem. What is data? And how do you add/replace the data in the underlying data list of the second table?
Re: nattable is not getting updated on adding the data to eventlist [message #1713781 is a reply to message #1713775] Fri, 06 November 2015 10:53 Go to previous messageGo to next message
Eclipse UserFriend
initially i am passing empty eventlist to the second table while creation . So basically m updating the glazedlist in the listener of firsttable.
could u suggest me any other way to do the same where i can update the glazedlist of the 2nd table and ui gets updated automatically.
Re: nattable is not getting updated on adding the data to eventlist [message #1713787 is a reply to message #1713781] Fri, 06 November 2015 11:10 Go to previous message
Eclipse UserFriend
don't update the list, clear() and addAll() the values. Or use GlazedLists#replaceAll()

Exchanging the list doesn't work if you don't provide a dataprovider that supports setting the list.
Previous Topic:Set background color to specific row
Next Topic:ignoring number of persisted rows (while restoring table)
Goto Forum:
  


Current Time: Wed Jun 18 15:04:32 EDT 2025

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

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

Back to the top