Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Refresh NatTable (Refreshing the NatTable on Model Update)
Refresh NatTable [message #1712122] Wed, 21 October 2015 12:09 Go to next message
Shashi Mising name is currently offline Shashi Mising nameFriend
Messages: 47
Registered: August 2011
Member
Hello All,

I created the NatTable by using the ListDataProvider and IColumnPropertyAccessor and used FilterList, GlazedListsEventLayer, GlazedListTreeData, ITreeRowModel for event handling and displaying the data in tree format.

Implementation Details :
-----------------------------------
1. created an emf model, initialized it with the data from the xml file.
2. retrieve the selected data from the emf model and set it to the natTable.
3. natTable working fine as expected.

When Problem occur:
-------------------------------
1. when user modify the xml file from notepad and gets this change notification in the code.
2. after modifying the xml file I am re-initializing the model.and refresh the table.
3. after refreshing the natTable the changes in the model does not appearing in the table.

so could someone explain me the best approach to solve this problem

that is when file gets modified, the model get reinitialized, so how to set this reinitialized model data to the table.

Thanks

Regards
Shashi

Re: Refresh NatTable [message #1712128 is a reply to message #1712122] Wed, 21 October 2015 12:40 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2809
Registered: July 2012
Senior Member
What impact should NatTable have related to your model? You only say that you are setting the model data to the NatTable instance. What does that mean?
Re: Refresh NatTable [message #1712130 is a reply to message #1712128] Wed, 21 October 2015 12:53 Go to previous messageGo to next message
Shashi Mising name is currently offline Shashi Mising nameFriend
Messages: 47
Registered: August 2011
Member
What impact should NatTable have related to your model? You only say that you are setting the model data to the NatTable instance. What does that mean?

Answer :

Hello Dirk, at first time when I read the data from the xml file and set it to the model and I am taking the limited data from the model which I am displaying in the table.

like below :

EventList<Object> eventList = GlazedLists.eventList(modelData);

TransformedList<Object, Object> rowObjectsGlazedList = GlazedLists
.threadSafeList(eventList);

SortedList<Object> sortedList = new SortedList<Object>(
rowObjectsGlazedList, null);

FilterList<Object> filterList = new FilterList<Object>(sortedList);

TreeList<Object> treeList = new TreeList<Object>(filterList,
new TestTreeFormat(), TreeList.nodesStartCollapsed());


but when the xml file modified by the user I have to reinitialize the model and display the new data in the table but it is not happening when I refresh the table when model get updated with new data.
Re: Refresh NatTable [message #1712161 is a reply to message #1712130] Wed, 21 October 2015 15:30 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2809
Registered: July 2012
Senior Member
I'm still not sure what modelData is, but why do you expect that the contents in the EventList update magically? Have you debugged if the contents in the modelData are updated?

I would assume that modelData and therefore the EventList still contain the data from the beginning and did not update.
Re: Refresh NatTable [message #1712424 is a reply to message #1712161] Sat, 24 October 2015 07:47 Go to previous messageGo to next message
Shashi Mising name is currently offline Shashi Mising nameFriend
Messages: 47
Registered: August 2011
Member
I'm still not sure what modelData is, but why do you expect that the contents in the EventList update magically? Have you debugged if the contents in the modelData are updated?

Answer : modelData is the data list read from the xml file, each time i have to read the xml file and updating the modelDataList.

why do you expect that the contents in the EventList update magically?
Answer : here i do not know how to set the event list each time when modelData updated and refresh the table.

could you please suggest the way how to achieve it.


Thank you

Regards
Shashi
Re: Refresh NatTable [message #1712431 is a reply to message #1712424] Sat, 24 October 2015 12:12 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2809
Registered: July 2012
Senior Member
If you have created an EventList for the NatTable, simply perform a clear() and addAll(). Simple Java Collection API.
Previous Topic:Default: case sensitive sort, change to case insensitive
Next Topic:Printing is incorrect when setting vertical painting style in Column Headers
Goto Forum:
  


Current Time: Fri Apr 23 09:25:38 GMT 2021

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

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

Back to the top