James
James

Reputation: 1277

GWT table add entry row

I'm new to GWT and am trying to create a table to display my data in. I started using a datagrid (as I wanted hierarchical headers as in the datagrid showcase example). My other requirement is that the top row be a dedicated "add entry row", i.e. it is empty row where the cells hold input boxes that can be completed by the user, and the last column contains an "Add" button to add the completed item to the data set. All other data is in the table is non editable and once the "Add" row button is clicked, the contents of the "add entry row" are written to the permanent table contents a the "add entry row" is cleared.

As I'm new to GWT I thought I'd check if there is an easy way to achieve this functionality? Or can anyone offer advice as to how best implement this?

Upvotes: 0

Views: 2088

Answers (1)

Suresh Atta
Suresh Atta

Reputation: 121998

After You click on ADD button .

Create YourObject with those values and ,Then you can add one record to the listdata

which is populating your DataGrid.

By using below code you can acheive that :

//TO DO  create `yourObject` here with new values 
ListDataProvider.getList.Add(yourObject);
ListDataProvider.refresh();

Upvotes: 1

Related Questions