LabelButton
Add clicking features to label. To be used in forms where normal buttons aren't suitable.
Developed to use case where you want to present values in form with label, but offer edit functionality when clicked. Normal button also reserves caption for itself; where LabelButton leaves presentation of caption to parent layout, and uses value as it's own presentation value. This could be useful in forms where leaving caption out breaks the nice look'n feel of layout.
Add-on has been OSGi bundled.
Sample code
LabelButton label = new LabelButton("Caption", "Show notification", event -> Notification.show("Clicked!")); // Add-on provides some nice styling out-of-box. There add link style underlining and pointer cursor label.addStyleName(LabelButtonStyles.HOVER_UNDERLINE_WHEN_CLICKABLE); label.addStyleName(LabelButtonStyles.POINTER_WHEN_CLICKABLE); parentLayout.add(label); // .. you can easily jump between normal label and clickable state with label.setClickable(false); // behaves like normal label // .. and label.setClickable(true); // enables all click features and styling
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
- Adds mode where LabelButton will not show tooltips. This is for users of ColumnLayout add-on's material design mode. Where parent layout shows the errors and descriptions of children.
- By default with Valo's theme, will match color with link buttons
- Released
- 2015-08-31
- Maturity
- BETA
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 7.4+
- Vaadin 8.0+ in 0.2.0
- Browser
- Browser Independent
Vaadin Add-on Directory
Find open-source widgets, add-ons, themes, and integrations for your Vaadin application.