Jonathan Pilborough schrieb:
>Hi,
>I want to use qx.io.remote.RemoteRequest to fetch some data then put into a
>table widget.
>The parsing will be handled in the completed event. The trouble is, I
can't pass data
>back from the event handler, and I can't work out how to give the event
handler the
>table to fill through a custom data parameter. Is there some method to
pass arbitrary
>variables to an event handler, or am i going about this the wrong way?
>Regards,
>Jonathan Pilborough
>
Without your code, I could only copy an example of my request-Function
as an offer:
qx.Proto.listReq = function(path, callBackOk, callBackError, callObj) {
var req = this.buildRequest("getFileList", path);
req.addEventListener("completed", function(e) {
if (e.getData().getStatusCode()==200) {
var resData = e.getData().getContent();
var resObj = qx.io.Json.parseQx(resData);
callBackOk.call(callObj, resObj);
}
callBackError.call(callObj, e.getData().getStatusCode());
});
req.addEventListener("failed", function(e) {
callBackError.call(callObj, "failed");
}, this);
req.addEventListener("timeout", function(e) {
callBackError.call(callObj, "timeout");
});
req.send();
};
How to use in your qx-application - (untested example code):
qx.Proto.myGui = function() {
var myTable;
var self = this;
myTable.addEventhandler("somethingToChange", function() {
self.listReq(currentPath,
function(myData) { myTable.updateData(myData) },
function(myErr) { this.debug(myErr); },
this);
});
}
Hoping this helps,
bye, Christian.
--
Christian Harms
Softwareentwicklung - Online Services
Brauerstraße 48 · D-76135 Karlsruhe
Tel. +49-721-91374-4821 · Fax +49-721-91374-2740
[EMAIL PROTECTED] - http://web.de/
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel