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.
The first way to do it, is to use an instance of the class Button
and set the CSS style to Reindeer.BUTTON_LINK
. So we get a component that looks like a link that has listeners for catching events.
public class Demo extends UI { @Override public void init(VaadinRequest request) { Button button = new Button("Vaadin"); button.addClickListener(new...