Roughian Examples Site Map - GWT Examples - Tutorials

Hyperlink


Version 1.0 onwards

The Hyperlink sends the user to another part of the application



Listeners



Notes


The Hyperlink works with the History class to whizz users around your application. It's beyond the scope of this page to explain the History class here, but in case you aren't familiar with it, it takes a token (the bit after the '#' in the url) and uses it to configure the application in a certain way. The token 'Home' on this site will send you to the home page. The token 'Widgets~Hyperlink' will open the 'Widgets' menu and display the 'Hyperlink' page - i.e. this one.

Although it is a GWT widget, the Hyperlink is a true link and you can right-click it and the browser will supply options like 'Open in a new window'.


Personal, Biased Opinion


Hyperlinks that aren't part of a structured menu system will confuse users in many cases. Although it is tempting to help the user by adding links, they don't respond well to being transported a la Startrek to another location. 'Next', 'Up' and 'Prev' are fine, but I'd use links that jump to related but distant pages sparingly.


Code


Hyperlink widget = new Hyperlink("Home Page", "Home");
SingleCellPanel panel = new SingleCellPanel();
panel.setSize("200px", "30px");
panel.addStyleName("demo-panel");
panel.add(widget);
RootPanel.get("demo").add(panel);