user1984327
user1984327

Reputation: 31

smartGWT add record into listGrid

I have client, server and somewhere in the middle my own defined datasource.

on the client, I have form, which values I want to add to, as a record into my listGrid, which is displayed right below. Anyone can give my a hint?

What I did so far, was, I sent the values from the form as a object to the server. It saved the object into file. When I wanted to display the newly entered object I had to fetch again.. I don´t want that.

Upvotes: 1

Views: 2369

Answers (1)

Arek
Arek

Reputation: 3176

If your datasource extends any implementation of com.smartgwt.client.data.DataSource then don't use form to send data but use com.smartgwt.client.data.DataSource.addRecord(Record) method. It'll cause client-server communication and all the magic will be performed by SmartGWT.

If your datasource does not extend com.smartgwt.client.data.DataSource then use ListGrid.addData(Record) just after you'll receive confirmation from the server side that data was successfully stored.

Upvotes: 1

Related Questions