Define your anchor in uibinder and use @UiField(provided = true) in thejava 
file. Then instantiate it with that url before the binding call.

On Friday, February 1, 2013 5:18:34 PM UTC+1, membersound wrote:
>
> I'm using ui:binder. How should I provide href for the anchor as 
> GWT.getModuleBaseURL()?
>
> Am Freitag, 1. Februar 2013 17:13:06 UTC+1 schrieb Thomas Broyer:
>>
>> Can't you just link to your servlet?
>>
>> <a href="{0}">Download</a> (where {0} is replaced with your URL)
>>
>> or new Anchor("Download", GWT.getModuleBaseURL() + "MyServlet")
>>
>> On Friday, February 1, 2013 4:57:06 PM UTC+1, membersound wrote:
>>>
>>> Hi,
>>>
>>> I created a servlet that provides a downloadable file (from String 
>>> content) by writing to the ServletOutputStream.
>>> On the client side, I trigger the file download by an Anchor with:
>>>
>>> Window.open(GWT.getModuleBaseURL() + "MyServlet", "_blank", "");
>>>
>>> It works fine, BUT it seems to open a new browser window, which is 
>>> somehow directly closed. After this the file download dialog is show.
>>> How can I prevent this flickering of a new browser window? Can't I 
>>> achieve this somehow inline?
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to