In my application I want users to be able to download a file from the
server (via a servlet), but **not** require them to enable pop-ups, as
they do if I use
native void openURLInNewWindow(String url) /*-{
$wnd.open(url);
}-*/;
I tried this class. It works under Firefox, but not with IE or
Safari:
public class DownloadIFrame extends Frame
implements LoadHandler, HasLoadHandlers {
public DownloadIFrame(String url) {
super();
setSize("0px", "0px");
setVisible(false);
addLoadHandler(this);
RootPanel.get("__gwt_downloadFrame").add(this);
setUrl(url);
}
public HandlerRegistration addLoadHandler(LoadHandler handler) {
return addHandler(handler, LoadEvent.getType());
}
public void onLoad(LoadEvent event) {
}
}
On my application's HTML page, I have
<iframe src="javascript:''" id="__gwt_downloadFrame" tabIndex='-1'
style="position:absolute;width:0;height:0;border:0"></iframe>
My application is loaded into a separate <div>
Any ideas how to make this work in IE and Safari?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---