Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create clickable link with GWT?

Tags:

html

gwt

I want to make some clickable links with GWT. I'm not sure if this is the best practice for it. Basically I want something that similar like this if I would've written with html

<a href="index.html" alt="">Link</a>

like image 301
starcorn Avatar asked Jan 22 '11 21:01

starcorn


1 Answers

Use a Hyperlink if you want to "link to some place" in your app (meaning it fires a History change event).
Use an Anchor if you want to link to a site ouside of your app.

Hyperlink link = new Hyperlink("link to foo", "foo"); //text would be "link to foo", would change your url to yourSite.html#foo
Anchor anchor = new Anchor("Link to bar", "www.bar.com"); //text would be "link to bar", would redirect you to "www.bar.com"
like image 179
Chris Boesing Avatar answered Oct 26 '22 12:10

Chris Boesing