Directory

← Back

tgglbttn-v7 Add-on

tgglbttn-v7 is a toggle button widget for Vaadin 7

Author

Rating

Popularity

<100

tgglbttn-v7 is an addon that brings on simple widget, a ToggleButton, which looks like a regular Button, but can be in two states (like CheckBox): up (representing false value) and down (representing true value). Can be used with TouchKit.

Sample code

final VerticalLayout layout = new VerticalLayout();
final ToggleButton button = new ToggleButton("I am toggle button. Click me");
button.setRequired(true);
layout.addComponent(button);

button.addValueChangeListener(new ValueChangeListener() {
        @Override
        public void valueChange(ValueChangeEvent event) {
        Notification.show("Value changed to " + button.getValue());
        }
});
final VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
layout.setSpacing(true);


final ToggleButton button = new ToggleButton("I am toggle button. Click me");
button.setRequired(true);
layout.addComponent(button);

button.addValueChangeListener(new ValueChangeListener() {

    @Override
    public void valueChange(ValueChangeEvent event) {
        Notification.show("Value changed to " + button.getValue());
    }
});


final Button changeState = new Button("Click here to change value on the toggle button");

changeState.addClickListener(new Button.ClickListener() {    
    @Override
    public void buttonClick(ClickEvent event) {
        button.setValue(!button.getValue());
    }
});

layout.addComponent(changeState);

Compatibility

(Loading compatibility data...)

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

Changed submodules' poms to not depend on parent pom, as this caused problems when using binary artifact downloaded from the Vaadin directory Maven Repository

Released
2014-05-05
Maturity
STABLE
License
Apache License 2.0

Compatibility

Framework
Vaadin 7.1+
Vaadin 7.2+ in 1.1.0
Browser
Internet Explorer
Firefox
Opera
Safari
Google Chrome
Internet Explorer
iOS Browser
Android Browser
Internet Explorer

Vaadin Add-on Directory

Find open-source widgets, add-ons, themes, and integrations for your Vaadin application. Vaadin Add-on Directory
The channel for finding, promoting, and distributing Vaadin add-ons.
Online