Question

I have a class 'Contact' with the attributes:

id
name
email

the id is created by the database whenever a new Contact is created. These Contacts are displayed in the UI using a Dojox DataGrid which uses a JsonRestStore.

When creating a new Contact via

personStore.newItem({name: "foo", email: "foo@acme.org"});
personStore.save();

the client executes a 'HTTP POST' request with a JSON request body which is processed by the backend and a new Contact with a unique id is created in the database.

Now the new Contact contained by the JsonRestStore has to be updated with the id created by the backend. How can this be done? What is the expected return of the 'HTTP POST'?

Was it helpful?

Solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top