blob: 8e1d9851717f32f127ec30bcec35d995d471d624 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
package com.vaadin.tests.components.radiobuttongroup;
import com.vaadin.annotations.Widgetset;
import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.ui.Button;
import com.vaadin.ui.RadioButtonGroup;
import java.util.Arrays;
@Widgetset("com.vaadin.DefaultWidgetSet")
public class RadioButtonGroupAfterVisibilityChange extends AbstractTestUI {
@Override
protected void setup(VaadinRequest request) {
RadioButtonGroup<Boolean> radio = new RadioButtonGroup<>("Radio",
Arrays.asList(true, false));
radio.setId("radioButton");
addComponent(radio);
Button hideButton = new Button("Hide");
hideButton.setId("hideB");
hideButton.addClickListener(event1 -> radio.setVisible(false));
addComponent(hideButton);
Button setAndShowButton = new Button("Set and Show");
setAndShowButton.setId("setAndShow");
setAndShowButton.addClickListener(event1 -> {
radio.setValue(true);
radio.setVisible(true);
});
addComponent(setAndShowButton);
}
}
|