How to display button as a link in vaadin?

Hello,

I am working on a Vaadin based web application. I want the button to be displayed like link but it should work like a button.

I would like to attach the event just like a button.

How to achieve this?

Thanks

View Answers

September 25, 2015 at 12:09 AM

Hi,

You can use the following code:

final Button btnClickMe = new Button("Click Me");
btnClickMe.setStyleName(BaseTheme.BUTTON_LINK);
btnClickMe.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(final ClickEvent event) {
               //Your code here

            }
        });

The function:

btnClickMe.setStyleName(BaseTheme.BUTTON_LINK);

is used to make a button look like as link.

Thanks









Related Tutorials/Questions & Answers:
Advertisements