[Dojo-interest] Some more questions on JsonRestStore

Maulin Shah, MD maulinpshah at gmail.com
Wed Aug 6 14:27:55 UTC 2008

JsonRestStroe adheres to the Http protocol for REST, and so I think requires
the new ID to be set in the header as Content-Location, or something like
that. I'd have to search for the exact usage, but you can do that!

On Wed, Aug 6, 2008 at 6:57 AM, Peter Svensson <psvensson at gmail.com> wrote:

> Hi!
> I'm (helping out with) writing a GAE backend for the JsonRestStore, and
> we've come pretty far at the moment. The problem is as follows;
> When I call store.newItem(); I get a new nice row in my DataGrid (Dojo 1.2a
> from SVN).  When this is saved, by calling store.save(); the server replies
> with the newly created object;
> {"id": "1"}
> So far so good, but the store doesn't bite on this. Oh no. Later when I've
> updated a field and call store.save(); it tries to call PUT on
> /whatever/3907ed65a4406cf24 instead of whatever/1
> Now I've tried to do a POST of my own to create the object, extract the id,
> and use the following instead on return;
> store.newItem({id: theserversideid})
> And that works, sort of. Unfortunately, the store thinks it has an
> outstanding new item which has to be syncronized with the server, so it
> calls POST by itself (of course), creating two objects and the fun begin
> again :)
> What would be the simplest way of making this work?
> Chers,
> PS
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://dojotoolkit.org/docs/book
> Forums: http://dojotoolkit.org/forum
> Dojo-interest at dojotoolkit.org<http://dojotoolkit.org/forumDojo-interest@dojotoolkit.org>
> http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://turtle.dojotoolkit.org/pipermail/dojo-interest/attachments/20080806/5a77c563/attachment.html 

More information about the Dojo-interest mailing list