PDA

View Full Version : DataGlue.bindFormatFunction scope Question, when using oop


mediaholic
11-23-2005, 09:13 PM
I have following Problem

My “trace(re.result);” in my function handleXYZ works and outputs the result
But the my Formating function “formatDataGlue” is newer called.

Class X{
public function handleXYZ (re : ResultEvent)
{
trace(re.result);
DataGlue.bindFormatFunction (myComboBox, re.result, formatDataGlue);//doesn’t work???
DataGlue.bindFormatFunction (myComboBox, re.result, this.formatDataGlue);//this neither???
}
function formatDataGlue (o : Object) : Object
{
trace("formatDataGlue");//this is newer traced????
return {label : o, data : o};
}
}

it looks like scope Problem but I cant figure out how to solve it, any ideas?

ctiggerf
07-05-2006, 06:32 PM
I am having a very similar problem and haven't had any luck tracking it down (or getting anyone to answer a question about it)

Here is a snippet of my code:
//Create binder function used with DataGlue.bindFormatFunction
function my_binder(record) {
trace("In Binder");
var dataObj=new Object();
dataObj.label=record.name;
dataObj.data=record;
trace("Done In Binder");
return dataObj;
}

//Create responder method for part info
function get_parts_result(parts_rs) {
trace("Got A Result");
trace("First Record="+parts_rs[1].name);
DataGlue.bindFormatFunction(parts_lb, parts_rs, my_binder);
trace("Done Binding");
}

Here is what I get in the trace:
-----------------------------------------
Got A Result
First Record=Record Pro-fit Pedals
Done Binding
-----------------------------------------

Hopefully someone can help us out.