Documentation on mx.processor.getObjectsByXPath

3
I'm working on a custom widget. Where can I find information on mx.processor.getObjectsByXPath? I need the results sorted. Or should I use a different method for that? Thanks. Toon
asked
2 answers
5

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);
            })
    });
answered
2

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

answered