Hi Peperoni,

find my code below (which I think can be simplified by using a text/json
mime type). I can't see an advantage in making an async call here.

qx.OO.defineClass("MyTableModel", qx.ui.table.RemoteTableModel,
function () {
  qx.ui.table.RemoteTableModel.call(this);
});

qx.Proto._loadRowCount = function() {
    var req = new qx.io.remote.Request("service/test/rowCount.json", "GET",
"text/plain");
    req.setAsynchronous(false);
    var data = 0;
    req.addEventListener("completed", function(e) {
        data = e.getData().getContent();
        this.debug("Got response " + data);
        data = qx.io.Json.parseQx(data);
        this.debug("Json parsed this: " + data);
    }, this);
    req.send();

    this._onRowCountLoaded(data);
};

qx.Proto._loadRowData = function(firstRow, lastRow) {
    this.debug("call to _loadRowData(" + firstRow + "," + lastRow + ")");

    var req = new qx.io.remote.Request("service/test/rowData.json", "GET",
"text/plain");
    req.setAsynchronous(false);
    var testData = [];
    req.addEventListener("completed", function(e) {
        this.debug("Got response " + e.getData().getContent());
        testData = qx.io.Json.parseQx(e.getData().getContent());
        this.debug("Json parsed this: " + testData);
    }, this);
    req.send();

    this._onRowDataLoaded(testData);
};

Martin


peperoni <[EMAIL PROTECTED]> wrote: 
>
>
>
>> qx.Proto._loadRowCount = function() {
>>    ...
>>    mycall = rpc.callAsync(this._setLoadedRowCount, "getRowCount");
>>    this._onRowCountLoaded();
>> };
>
>> You have to call _onRowCountLoaded when you have the result, not 
>> directly after sending your asynchronous request.
>
> 
>When I don call _onRowCountLoaded I get an error and 40 log windows are
>opening and I get the following error:
>
>010641 ERROR: qx.io.remote.RemoteRequest[111]: Could not dispatch event of
>type "completed": TypeError - this._onRowCountLoaded is not a function
>
>The Coments in the remote Table Model say the following:
>
>/**
> * Loads the row count from the server.
> * <p>
> * Implementing classes have to call [EMAIL PROTECTED] _onRowDataLoaded()} 
> when the
>server
> * response arrived. That method has to be called! Even when there was an
>error.
> */
>
>The problem is that I can`t call _onRowCountLoaded in the callback
>function.
>When I try to call it like this: this._onRowCountLoaded(); 
>
>How do I call _onRowCountLoaded from the callback function?
>-- 
>View this message in context:
>http://www.nabble.com/Problem-with-RemoteTableModel-tf2765605.html#a7718879
>Sent from the qooxdoo-devel mailing list archive at Nabble.com.
>
>
>-------------------------------------------------------------------------
>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
>
>
-- 
Martin Schaefer
NAXOS Software Solutions GmbH
Managing Director 

Herrenstr. 1 
69502 Hemsbach 
Germany 

Phone:  +49 (0) 6201 84433-00 
Fax:    +49 (0) 6201 84433-29 
Mobile: +49 (0) 172 6269246
http://www.naxos-software.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

Reply via email to