Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#7331 closed defect (fixed)

jsonpathstore with null json object throws Error

Reported by: umeshkudtarkar Owned by: Dustin Machi
Priority: high Milestone: 1.4
Component: DojoX Data Version: 1.1.1
Keywords: Cc:
Blocked By: Blocking:

Description

I am using jsonPathStore in my application. When my json data has null objects I see following

error in firebug console

TypeError?: item has no properties message=item has no properties”

My json data looks like this

{ Identifier: "name", "items":[

{"approved":1,"description":"","mailingStats":null }, {"approved":1,"description":"","mailingStats":{"elapsedTime":"0 Days 00:20:32","timeCompleted":"2008-07-24T14:27:18"},

… …

]}

On further investigation I found out while doing setData on jsonPathStore buildIndex() is called which throws this error for null objects. To fix this problem I am setting indexOnLoad property to false. This seem to fix the problem. I also tried dojo query against store and that also seem to work. Though according to api documentation this buildIndex is necessary.

Change History (6)

comment:1 Changed 11 years ago by Jared Jurkiewicz

Owner: changed from Jared Jurkiewicz to Dustin Machi

comment:2 Changed 11 years ago by bill

Milestone: tbd1.3

Owners should mark these bugs w/a milestone (possibly future). Putting into 1.3 milestone temporarily (since 1.2RC has already been made)

comment:3 Changed 10 years ago by Dustin Machi

Milestone: 1.31.4

Have a new version of this store, but its not quite finished yet.

comment:4 Changed 10 years ago by dante

Milestone: 1.4future

comment:5 Changed 10 years ago by Dustin Machi

Resolution: fixed
Status: newclosed

(In [20831]) jsonPathStore is out of sync due to the more advanced dojox.json capabilities. To avoid confusion with these, I'm removing this widget as I dont' plan to support it going forward. There is an equivalent widget which uses dojox.json ref and query in dojoc/dmachi/data called JsonStore? for those who still need this capability. While they are not drop in replacements of each other, they are pretty close and it should not take a significant amount of time to convert, and the benefits gained in performance and querying flexibility are worth it. closes #7473 closes #8175 closes #7331 closes #7403 closes #8312 closes #8334 closes #9976 closes #10290

comment:6 Changed 10 years ago by bill

Milestone: future1.4
Note: See TracTickets for help on using tickets.