Hello!
I try to use a member function as a callback for my P2P Ajax function. However,
the function is always "undefined". Here is the relevant code of my application:
--------------8<-------------------------------------------
main : function()
{
[...]
// Create a button
var button1 = new qx.ui.form.Button("First Button", "edemo/test.png");
// Document is the application root
var doc = this.getRoot();
// Add button to document at fixed coordinates
doc.add(button1, {left: 120, top: 50});
// Add an event listener
console.log( 'HandlerDef: '+this.__handleButton );
button1.addListener("execute", this.__handleButton );
},
__fillTable : function( pRequest ) {
alert( pRequest );
},
__handleButton : function(e) {
var hrq = new edemo.AjaxTools();
console.log( 'Callback: '+this.__fillTable );
hrq.sendXMLHTTPRequest( '<QD_FETCH_TEST/>', this.__fillTable, null, false
);
}
--------------8<-------------------------------------------
Here the "HandlerDef" trace prints the right method and it is successfully
assigned to the event handler, OTOH, when calling it and tracing the "callback"
function, it returns undefined.
I am sure I missed some vital aspect of the OO framework, but can't see why
doesn't sees the function? Or the this is "lost" (refers to another object) for
a function when called as an event handler?
Thanks,
Balage
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel