Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#9242 closed defect (invalid)

fetch & fetchItemByIdentity have problems with the JsonRestStore

Reported by: Kenny Owned by: Kris Zyp
Priority: high Milestone: tbd
Component: DojoX Data Version: 1.3.0
Keywords: Cc:
Blocked By: Blocking:


If I create a JsonRestStore? and then just after that, I do a fetchItemByIdentity on it, the result will be all the items. The filter seems not be applied.

Same with the fetch function.

I tried also to do a simple fetch() before doing the fetchItemByIdentity.

I discovered that if I use the setTimeout function with at least 50ms (49 fail to work), then the fetchItemByIdentity function works good but the fetch still doesn't work, even with 1000ms.

I put a test case in the file attached.

Attachments (1)

jsonRestStore.html (4.5 KB) - added by Kenny 13 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 13 years ago by Kenny

Here is the Json I'm sending from a file called test.json on the same level:

  {"id":"1", "name":"Maulin Shah, MD", "pager":{$ref:"24"} },
  {"id":"2", "name":"Doogie Howser, MD", "pager":{$ref:"12"} }

Changed 13 years ago by Kenny

Attachment: jsonRestStore.html added

comment:2 Changed 13 years ago by Jared Jurkiewicz

Owner: changed from Jared Jurkiewicz to Kris Zyp

comment:3 Changed 13 years ago by Kris Zyp

Resolution: invalid
Status: newclosed

This is because you are calling fetchItemByIdentity before the fetch response has been received. Consequently, there is no item with the given id available locally, so JsonRestStore? must do a request, which goes through your custom REST service function which returns the full array of items as the response to the request for "1". If you put fetchItemByIdentity in the onComplete callback for fetch, you should be able to retrieve the appropriate item.

comment:4 Changed 13 years ago by bill

Does JsonRestStore pass a parameter to the custom REST service specifying an id, which it's apparently ignoring?

comment:5 Changed 13 years ago by Kris Zyp

Yes, the custom service is ignoring the id and always returning the same array in the example code.

Note: See TracTickets for help on using tickets.