Button.STYLE_LINK

Hi Joonas,
I tried the same example as this, but my application for some reason not recognising the style for the button at all, b.setStyleName(“link”) or b.setStyleName(“Button.STYLE_LINK”) is not working as intended. Please help.

Thanks

Define the STYLE_LINK without quotes, like this:

b.setStyleName(Button.STYLE_LINK);

Button.setStyleName(“link”) should work equally well as Button.setStyleName(Button.STYLE_LINK).

Be sure that you do not call setStyleName again for the same button later, that will replace all previous styles. You could use Button.addStyleName instead.