Opened 11 years ago

Closed 11 years ago

Last modified 9 years ago

#7732 closed defect (fixed)

ServiceStore fetchItemByIdentity onError

Reported by: maulin Owned by: Kris Zyp
Priority: high Milestone: 1.2
Component: DojoX Data Version: 1.2beta
Keywords: Cc: kris@…
Blocked By: Blocking:

Description

need to hook up args.onError

patch:

### Eclipse Workspace Patch 1.0 #P dojo-dev Index: dojox/data/ServiceStore.js =================================================================== --- dojox/data/ServiceStore.js (revision 15324) +++ dojox/data/ServiceStore.js (working copy) @@ -118,7 +118,7 @@

property to look up value for

var val = this.getValue(item,property);

  • return val instanceof Array ? val : [val];

+ return val instanceof Array ? val : val === undefined ? [] : [val];

},

getAttributes: function(item){

@@ -333,6 +333,7 @@

},

fetchItemByIdentity: function(args){

+ console.debug("servcestore fetchitembyid", args);

summary: fetch an item by its identity, by looking in our index of what we have loaded

var item = this._index[(args._prefix
) + args.identity];

@@ -340,9 +341,11 @@

args.onItem.call(args.scope, item);

}else{

convert the different spellings

+ console.debug("args", args);

return this.fetch({

query: args.identity,

  • onComplete: args.onItem

+ onComplete: args.onItem, + onError:args.onError

}).results;

} return item;

Change History (5)

comment:1 Changed 11 years ago by maulin

woops. also forgot to add scope in the args.

### Eclipse Workspace Patch 1.0 #P dojo-dev Index: dojox/data/ServiceStore.js =================================================================== --- dojox/data/ServiceStore.js (revision 15324) +++ dojox/data/ServiceStore.js (working copy) @@ -342,7 +342,9 @@

convert the different spellings return this.fetch({

query: args.identity,

  • onComplete: args.onItem

+ onComplete: args.onItem, + onError:args.onError, + scope:args.scope

}).results;

} return item;

comment:2 Changed 11 years ago by maulin

and lastly, forgot to return store.inherited in JsonRestStore?

### Eclipse Workspace Patch 1.0 #P dojo-dev Index: dojox/data/JsonRestStore.js =================================================================== --- dojox/data/JsonRestStore.js (revision 15324) +++ dojox/data/JsonRestStore.js (working copy) @@ -293,7 +293,7 @@

args.identity = serviceAndId.id;

} args._prefix = store.service.servicePath;

  • store.inherited(arguments);

+ return store.inherited(arguments);

}, Notifcation Support

comment:3 Changed 11 years ago by Jared Jurkiewicz

Owner: changed from Jared Jurkiewicz to kriszyp

comment:4 Changed 11 years ago by Kris Zyp

Milestone: tbd1.2
Resolution: fixed
Status: newclosed

comment:5 Changed 9 years ago by bill

Owner: changed from kriszyp to Kris Zyp
Note: See TracTickets for help on using tickets.