Matt,
qx.io.remote.Request and qx.io2.HttpRequest have different methods to get
the returned data from the server. qx.io.remote.Request fires a "completed"
event and qx.io2.HttpRequest fires a "load" event when the data is returned
(as your code shows). However you use the e.getContent() with the former
and you use req.getResponseText() or req.getResponseXml() to get your data
with the latter.
The following should work if everything else is ok.
req.addListener("load", function(e) {
//composite.add(new
qx.ui.basic.Label(e.getContent()));
composite.add(new
qx.ui.basic.Label(req.getResponseText()));
});
see api documentation at
http://demo.qooxdoo.org/current/apiviewer/#qx.io2.HttpRequest
Matthew Curry wrote:
>
> Hello all,
>
> After spending some time getting a simple http server ready, I'd like
> to figure out how to talk to it with qooxdoo.
> My server spits out a series of JSON objects in plain text when you
> hit it with certain urls, and I've tested that part. I'm still really
> new to qooxdoo, and new to webprogramming also, but from reading the
> docs, it should be a simple matter of:
>
> // Document is the application root
> var doc = this.getRoot();
> var layout = new qx.ui.layout.VBox(5);
> var composite = new qx.ui.container.Composite(layout);
>
> //var req = new
> qx.io.remote.Request("http://localhost:4242/getfeeds", "GET",
> "text/plain");
> var req = new qx.io2.HttpRequest("http://localhost:4242/getfeeds");
> req.addListener("load", function(e) {
> composite.add(new
> qx.ui.basic.Label(e.getContent()));
> });
> req.addListener("error", function(e) { alert(e.getContent()); });
> req.send();
>
> doc.add(composite);
>
>
> I'm just trying to see the data at this point, I've tried alert boxes
> and I've tried making a Label and adding it to the root widget like
> above (and trying qx.io.remote and qx.io2.HttpRequest), but it seems
> like the request just doesn't complete. This code is pretty much
> lifted straight out of the manual, so I wonder if there's something
> I'm missing server side?
>
> My server access log (the server's hunchentoot, the lisp webserver) shows
> this:
> 127.0.0.1 - [2009-09-04 16:12:46] "OPTIONS /getfeeds HTTP/1.1" 200
> 1631 "-" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.2)
> Gecko/20090803 Fedora/3.5.2-2.fc11 Firefox/3.5.2"
>
> I thought I was making GET requests, not OPTIONS requests. My server
> responds the same way to either type.
> What am I missing? Any help will be much appreciated.
>
> Once I get the requests working, I'll be ready to dive into qooxdoo
> proper... looking forward to it.
>
> -Matt
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day
> trial. Simplify your report design, integration and deployment - and focus
> on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
--
View this message in context:
http://www.nabble.com/Which-remote-mechanism-to-use%2C-and-how-to-use-them--tp25301435p25302079.html
Sent from the qooxdoo-devel mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel