blob: 213258ed29f9857bf4fe2786d69a28abf2850fc7 (
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
36
37
38
39
40
41
42
43
|
package com.vaadin.tests.components.optiongroup;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Label;
import com.vaadin.ui.OptionGroup;
public class OptionGroupMultipleValueChange extends TestBase {
@Override
protected String getDescription() {
return "Clicking on the description of an option should behave exactly like clicking on the radio button. No extra 'null' valuechange event should be sent";
}
@Override
protected Integer getTicketNumber() {
return 3066;
}
@Override
protected void setup() {
final OptionGroup og = new OptionGroup();
og.addItem("Clicking on the text might cause an extra valuechange event");
og.addItem("Second option, same thing");
og.setImmediate(true);
addComponent(og);
final Label events = new Label("", ContentMode.PREFORMATTED);
events.setWidth(null);
addComponent(events);
og.addListener(new Property.ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
String s = "ValueChange: " + event.getProperty().getValue();
events.setValue(events.getValue() + "\n" + s);
}
});
}
}
|