I suggest using mx.processor.get. Documentation can be found here, or an example:
mx.processor.get({
xpath : xpath,
filter : {
limit : this.maxobjects ,
sort : [[this.defaultsortattr, "Asc"]],
attributes : ["Name" , "Age"],
depth : 0 //depth 0 results in all associations being retrieved as GUIDs, no support for depth yet, see bug #4899, luckely, the default is 0 as well :)
},
callback : dojo.hitch(this, this.retrieveData),
error: dojo.hitch(this, function(err) {
dojo.html.set(this.contentsNode, "Unable to retrieve data for xpath '" + xpath + "': " + err);
})
});
Hi Michel,
I did come across this piece of code in the NavigationTree widget. It suggest I can use getObjectsByXPath and still sort. Is that correct?
mx.processor.getObjectsByXPath(
//first level is retrieved without constraint on an association
"//" + this.levelData[0].entity + this.levelData[0].constraint,
//sort on caption
{ sort : [[this.levelData[0].attribute, "asc"]] },
//special handler
dojo.hitch(this, this.showFirstLevel),
//use cache
true
);
Do you know of documentation on this? Is there an API description?
Thanks Toon