O'Reilly logo

Vaadin 7 Cookbook by Ondrej Kvasnovsky, Jaroslav Holan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding click listener to the Link component

Vaadin provides support for the Link component. We can make hyperlinks via this component. References to locations are represented as resource objects. The Link component is a regular HTML hyperlink, that is, an <a href> anchor element that is handled natively by the browser. Unlike when clicking a Button, clicking a Link does not cause an event on the server side. However, if we need to cause an event we have two ways to do it. We will take a look at them in this recipe.

Adding click listener to the Link component

Getting ready

We create a Vaadin project with a topmost class named Demo.

public class Demo extends UI {…}

How to do it...

The first way ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required