How to put html into Button

Hi,
i’m currently using a button with the theme “Link” because i would like to create a link with a ClickListener attached to it, in order to open a sub window (like a login form in a modal window).
So this is my code


Button linkB = new Button("<li>Open form</li>");
linkB.setStyleName(BaseTheme.BUTTON_LINK);

But i can’t figure out how to put this button into [code]

  • [/code] markups. Is this the right way ?

    Thank you

  • You can’t put HTML in the button caption. You need to create a custom theme and style the button with CSS. Button has [tt]
    v-button
    [/tt] style class by default, but you can give the specific button a style with [tt]
    addStyleName()
    [/tt].

    See the
    Themes
    chapter and
    Button
    section for more information.

    Also, if you need the Button to be within a LI, you’ll probably want to use CustomLayout.

    Best Regards,
    Marc

    If you only need the bullet in front of the caption, you can achieve it with just CSS:

    .v-button-caption {
        display: list-item;
    }

    Thank you all for your answers,
    i think it pretty much answered my initial question.