Hi,

On 12 Sep., 09:33, Jason Morris <[EMAIL PROTECTED]> wrote:
> public class MyEntryPoint implements EntryPoint {
>         public void onModuleLoad() {
>                 String link = GWT.getModuleBaseURL() + 
> "servlet/myfiledownload";
>                 RootPanel.get().add(new HTML("<a href=\"" + link + 
> "\">Download File</a>"));
>         }
>
> }
>
> You can also use Window.open(link, "downloadWindow", "");
> to download the file from an EventListener.

If you just want to let the browser pop up a save-as-window, you can
also do the following:

In the HTML where the GWT-application resides put in the following:

<iframe src="" id="__download" style="width:0;height:0;border:0"></
iframe>

(or any other name for the id you want)

and start the download with the following code:

DOM.setElementAttribute(RootPanel.get("__download").getElement(),
"src", link);

Personally I prefer this kind of way because it behaves more like
you're
used to when working with a local application instead of being forced
to
click a link or open a popup containing nothing.


Best regards, Lothar

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to