How to provide a download button?https://www.eclipse.org/forums/index.php/mv/msg/405029/946851/#msg_946851
I found this link were it is described how to provide a download link. My Download-ServiceHandler is working nice but now i want to provide a button. How can I trigger a download in the current browser-tab without falling back to ExternalBrowser.open(..) (it forces the user to close that beast)?

Thanks Chris]]>Christian Schwarz2012-10-16T15:08:30-00:00Re: How to provide a download button?https://www.eclipse.org/forums/index.php/mv/msg/405029/946869/#msg_946869
with the markup support for Label you could put an <a> tag into a label
text that points to your download file or download service handler.
HTH,
Ivan

On 10/16/2012 6:08 PM, Christian Schwarz wrote:
> Hi RAP Fans,
>
> I found
> http://wiki.eclipse.org/RAP/FAQ#How_to_provide_a_download_link.3F link
> were it is described how to provide a download link. My
> Download-ServiceHandler is working nice but now i want to provide a
> button. How can I trigger a download in the current browser-tab
> without falling back to ExternalBrowser.open(..) (it forces the user
> to close that beast)?
>
> Thanks Chris

Professional services for RAP and RCP?http://eclipsesource.com/services/rap/]]>Ivan Furnadjiev2012-10-16T15:22:06-00:00Re: How to provide a download button?https://www.eclipse.org/forums/index.php/mv/msg/405029/947008/#msg_947008
Ivan Furnadjiev wrote on Tue, 16 October 2012 11:22

Hi Christian,
with the markup support for Label you could put an <a> tag into a label
text that points to your download file or download service handler.

Hi Evan,

thanks for your reply, I know the Label soulution from the FAQ but i need a Button. I figured out that it is possible to open a Browser pointing to the URL of the download service handler. I can hide the Browser by setting its size to zero in width & height, but i don't know when i should dispose the Browser instance. If i dispose it after calling #setUrl(String) noting happes (at least in IE8). ]]>Christian Schwarz2012-10-16T18:26:12-00:00Re: How to provide a download button?https://www.eclipse.org/forums/index.php/mv/msg/405029/947333/#msg_947333
]]>Chris Fairhall2012-10-17T02:23:33-00:00Re: How to provide a download button?https://www.eclipse.org/forums/index.php/mv/msg/405029/947519/#msg_947519
But yes one could place a "hidden" Browser some where in side the application an reuse it to trigger downloads, it feels like a dirty workaround. ]]>Christian Schwarz2012-10-17T06:47:42-00:00Re: How to provide a download button?https://www.eclipse.org/forums/index.php/mv/msg/405029/948918/#msg_948918
As far as I know, HTML/DOM doesn't provide a method to directly trigger
a download, doing so requires this kind of workaround. However, maybe it
would feel better if it was wrapped in a custom download widget?

Professional services for RAP and RCP?http://eclipsesource.com/services/rap/]]>Ralf Sternberg2012-10-18T14:08:42-00:00Re: How to provide a download button?https://www.eclipse.org/forums/index.php/mv/msg/405029/948957/#msg_948957
To answer your question about when to dispose the browser widget, you have to wait until the download is complete. That would be once the DownloadServiceHandler.service() method is complete, so you should setup some sort of listener to notify your view once the service handler finishes. Then you can dispose the Browser widget and unregister the service handler.