Howdy Y’all,
I’m trying to bind to a dataset from an xmlconnector. Here is my code:
the binding occurs but the dataset does not have any items (ie: length =0)
what is my problem?
i am also assigning schema and params to both components.
[AS]
function GenerateGraphData(sql){
trace(“depththingy:”+ mx.managers.DepthManager.kTop);
this.createObject(“XMLConnector”, “xCON”, curLevel++);
this.createObject(“DataSet”, “xDS”, curLevel++);
xCON.URL = server+sql;
xCON.direction = “receive”;
xCON.ignoreWhite = true;
xCON.params = new XML(XMLschema);
xDS.schema = new XML(DSschema);
trace("XMLConnector: "+xCON);
trace("URL: "+xCON.URL);
trace("DataSet "+xDS);
//trace("xCON Results: "+xCON.results);
var src = new EndPoint();
src.component = xCON;
//src.property = “results.NewDataSet.x0030”;
src.property = “results”;
src.location = “/NewDataSet/x0030”;
//src.event = “result”;
var dest = new EndPoint();
dest.component = xDS;
//dest.property = “dataProvider:Array”;
dest.property = “dataProvider”;
//dest.location = “Array”;
//dest.location = “XML”;
//dest.property = “items”;
bind = new Binding(src, dest);
xCON.trigger();
xCON.addEventListener(“result”, xConResults);
};
var xConResults = function (ev) {
trace("xConResults "+ev.target);
xDS.addEventListener(“afterLoaded”, xDsResults);
err = bind.execute();
trace(“just after execute dataProvider:”+ xDS.dataProvider._name);
trace(“Err:”+err);
trace(“just bound”+xDS.length);
//trace("xCON Results: "+xCON.results);
}
var xDsResults = function (ev) {
trace("xDsResults w/ xDs len: "+xDS.length+ " ev: "+ev.target);
for( var t = 0; t < xDS.length; t++ ){
trace(xDS.items[t]);
}
}
[/AS]