#8084 closed defect (fixed)
JsonRestStore Identity attribute not added when value is 0
Reported by: | Phil Kaasa | Owned by: | Kris Zyp |
---|---|---|---|
Priority: | high | Milestone: | 1.3 |
Component: | DojoX Data | Version: | 1.2.1 |
Keywords: | jsonreststore | Cc: | [email protected]… |
Blocked By: | Blocking: |
Description
Browser: Firefox 3.0.3 and IE 7.0 OS: Windows XP SP2
Summary: If the identity property of an object has 0 as its value, the JsonRestStore? (or something it inherits from) doesn't correctly add the id property when using the fetch() method. This makes it impossible to load that data in a DataGrid?.
I have a JsonRestStore? hooked up to a REST service that returns a JSON array of objects. The identity property of those objects is the "id" property.
For reference, this is sample data that my service might return (the data given will cause the behavior I am describing):
[{
"ani": 1993, "ccrId": 1809739408, "id": -2, "dnis": 930, "firstName": "Alex", "lastName": "Anderson"
}, {
"ani": 3140, "ccrId": 26349579, "id": -1, "dnis": 7799, "firstName": "Bob", "lastName": "Roberts"
}, {
"ani": 6671, "ccrId": 516548029, "id": 0, "dnis": 413, "firstName": "John", "lastName": "Anderson"
}, {
"ani": 7818, "ccrId": 880641847, "id": 1, "dnis": 8864, "firstName": "Jean", "lastName": "Adams"
}, {
"ani": 5959, "ccrId": 1935844040, "id": 2, "dnis": 5091, "firstName": "Alice", "lastName": "James"
}]
When I view the attached HTML, the attached output is shown on the console (first 5 lines using fetch(), last 2 lines using fetchItemByIdentity()).
As you can see, when I use fetch(), the id property is not added to the object when id=0; whereas when I use fetchItemByIdentity(), the id property is added when id=0.
This is causing an "Identity attribute not found" exception when I try to load data like this into a DataGrid?. Because of the exception, the grid is stuck loading. I do not receive that exception, and the grid loads correctly if the data doesn't include any objects where id=0.
Attachments (3)
Change History (7)
Changed 12 years ago by
comment:1 Changed 12 years ago by
Owner: | changed from Jared Jurkiewicz to kriszyp |
---|
comment:2 Changed 12 years ago by
Owner: | changed from kriszyp to Kris Zyp |
---|
comment:3 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 Changed 12 years ago by
Milestone: | tbd → 1.3 |
---|
batch move of tickets marked 'tbd' fixed in the 1.3 timeframe
Test Javascript.