[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.newcomer] Re: Adding data to already existing data in table

On 2/27/2009 4:29 AM, adithya wrote:
Hi,
I have supplied data to the table using the constructor while creating
the object and i am using tableviewer for showing the data..

I have added and 'add' and a 'delete' button to the composite holding
the table and the 2 buttons..

So,when the user selects 'add' button i am creating an object of the
class supplying data to the table and passing additional data to the
table using the constructor but it isn't working..

The TableViewer must have a ContentProvider, and that ContentProvider is getting the table contents from some "model." You need to add the new object to that "model" and then tell the refresh().


When using a TableViewer, you should not manipulate the Table widget contents directly - that is what the ContentProvider is for.

Hope this helps,
Eric