> Hi,
>
> it sounds trivial, but I'm missing the right idea.

I actually don't think that this is trivial.

> When a user clicks on a qooxdoo Button I want to start a download
> and not reloading my current page (e.g. in another browser tab
> (target="_blank")).
>
> this.exportButton.addListener("execute",  function(e){
>    var link = "http://xxx.com/download/xyz.csv";;
>    // ????? How to Trigger the download ????
> }, this);

I think Gleb's suggestion setting window.location is the right approach.
It might be an idea to consider a hidden iframe for this, but you have to
also take care of error handling and issues with mime types (e.g. when the
browser wants to render the download).

> PS: I also tried
>
> var request = new qx.io.remote.Request(link, "POST", "application/csv");
>         request.setUsername("xxxxx");
>         request.setPassword("yyyyy");
>         request.setAsynchronous(false);

In general, you shouldn't do this. Use asynchronous requests.

>         request.addListener("completed",  function(e){
>           alert("completed=" + e);
>         }, this);
>         request.send();

This will not help you, I guess, as remote requests deliver data to your
script, and do not trigger the browser to render them or open a Save As
dialog. In your script, you have e.g. no way of saving the data to disk.

> with no success (no request was triggered as of Firebug)

Did you really check the Net tab of Firebug? Even then, depending on your
Firefox/Firebug version, you might not see all the requests going out. A
better check for that are local web proxies, like Fiddler on Windows or
similar.

T.


------------------------------------------------------------------------------
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

Reply via email to