Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Update / refresh Nattable
Update / refresh Nattable [message #1057836] Thu, 09 May 2013 04:10 Go to next message
Nikhil Shirodkar is currently offline Nikhil Shirodkar
Messages: 9
Registered: May 2013
Junior Member
Hello ,

I have created a nattable , which is in side a Dialog box(JFace).
Along with this nattable the dialog box have few buttons too.
On click of one of these buttons i want to update the Nattable. Update - i.e. I want to change all the rows and data in the matrix.

For that I was trying to use natTable.refresh();
But unfortunately, i am not able to update the Table.

When tried for dispose , the Nattable disposes,but it does not work with refresh.
Am i missing something.

Please help me.


Thanking you in advance.
Re: Update / refresh Nattable [message #1057901 is a reply to message #1057836] Thu, 09 May 2013 11:51 Go to previous messageGo to next message
Nandita Uppalapati is currently offline Nandita Uppalapati
Messages: 13
Registered: March 2013
Junior Member
I have the same issue. I have a natTable with some drop downs outside of it. The very first time when I create a natTable it shows up. But when I choose a different value in the drop down, I am updating my data provider with entirely new rows and columns, disposing off the natTable instance and creating a fresh one using
natTable = new NatTable(parent, gridLayer, false);

When doing this I am creating a new data Provider instance with the new rows and columns, a new bodyLayer, compositeFreezeLayer and the likes. But the new natTable doesn't show up. When I minimize my application and maximize it that is when it shows up. I tried refresh, but I guess refresh only works for the existing instance of natTable and not a new one if I am not wrong. Is this a wrong approach?

[Updated on: Thu, 09 May 2013 11:52]

Report message to a moderator

Re: Update / refresh Nattable [message #1057908 is a reply to message #1057836] Thu, 09 May 2013 13:33 Go to previous messageGo to next message
Nandita Uppalapati is currently offline Nandita Uppalapati
Messages: 13
Registered: March 2013
Junior Member
Mine was a layout issue, unrelated to NatTable.

Thanks
Re: Update / refresh Nattable [message #1057925 is a reply to message #1057908] Thu, 09 May 2013 16:05 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1231
Registered: July 2012
Senior Member
Well how do you update the data? Usually the issue is related to updating the list itself without changing the reference in the DataProvider
Re: Update / refresh Nattable [message #1057946 is a reply to message #1057925] Thu, 09 May 2013 21:27 Go to previous message
Nikhil Shirodkar is currently offline Nikhil Shirodkar
Messages: 9
Registered: May 2013
Junior Member
Hello Dirk,

Well what I did is..
I exposed the lists containing the Column names and row names.
And on the button click event I changed values of the Column Names and Row Names (as a test).
And then tried for refresh nattable.

And it was not working.


But as you said "the issue is related to updating the list itself without changing the reference in the DataProvider" then I exposed the column Header data provide. And changed some values there. Then refreshed the nattable.

And did work... Smile

At least now I am able to update the row and column headers. Now I will work further to update the whole table.

Thanking you....
Previous Topic:Save to excel
Next Topic:Simple Cell Editing
Goto Forum:
  


Current Time: Thu Jul 31 07:38:58 EDT 2014

Powered by FUDForum. Page generated in 0.02229 seconds