markzzz
markzzz

Reputation: 47945

GWT - Create a link to external website

I need to create a link that point to another website, not to the portal itself trought ajax call. I write this at the moment :

InlineLabel fv1=new InlineLabel("Validator W3C : ");
InlineHyperlink linkfv1 = new InlineHyperlink("HTML" , "http://validator.w3.org/");

InlineLabel fv2=new InlineLabel(" | ");
InlineHyperlink linkfv2 = new InlineHyperlink("CSS" , "http://jigsaw.w3.org/");

but it call the portal. In fact, if i click on HTML it adds #http://validator.w3.org/ in the navigation bar. How can I fix this? Bye

Upvotes: 1

Views: 3766

Answers (2)

Jason Hall
Jason Hall

Reputation: 20920

The docs for InlineLabel say that it's meant to be used for "internal" links -- i.e., only to change the part after the #, like you're seeing.

You want to use Anchor -- this will result in an <a> tag being added to your page.

Upvotes: 3

Mr. Xymon
Mr. Xymon

Reputation: 1053

I prefer this solution:
Define an object of HTML class with the necessary parameters then add that object to a container in your GWT interface, FlowPanel for instance.

HTML link = new HTML("<a href=\"http://stackoverflow.com\" target=\"_blank\">Take me to stackoverflow</a>");
flowPanel.add(link);

Upvotes: 1

Related Questions