From: Artur Signell Date: Tue, 4 May 2010 14:09:39 +0000 (+0000) Subject: Test case for #4632 X-Git-Tag: 6.7.0.beta1~1691 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2864fe93543025b3903a28284dfc930c8becb940;p=vaadin-framework.git Test case for #4632 svn changeset:13028/svn branch:6.4 --- diff --git a/tests/src/com/vaadin/tests/components/combobox/ComboBoxEnablesComboBox.java b/tests/src/com/vaadin/tests/components/combobox/ComboBoxEnablesComboBox.java new file mode 100644 index 0000000000..6178d25a2a --- /dev/null +++ b/tests/src/com/vaadin/tests/components/combobox/ComboBoxEnablesComboBox.java @@ -0,0 +1,49 @@ +package com.vaadin.tests.components.combobox; + +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.ComboBox; + +public class ComboBoxEnablesComboBox extends TestBase { + + private ComboBox cb2; + + @Override + protected void setup() { + ComboBox cb = new ComboBox("Always enabled"); + cb.setImmediate(true); + populate(cb); + cb.addListener(new ValueChangeListener() { + + public void valueChange(ValueChangeEvent event) { + cb2.setEnabled(true); + } + + }); + cb2 = new ComboBox("Initially disabled"); + cb2.setImmediate(true); + cb2.setEnabled(false); + populate(cb2); + + addComponent(cb); + addComponent(cb2); + } + + private void populate(ComboBox cb) { + for (int i = 1; i < 10; i++) { + cb.addItem("Item " + i); + } + } + + @Override + protected String getDescription() { + return "Selecting an item in the first combobox enables the second."; + } + + @Override + protected Integer getTicketNumber() { + return 4632; + } + +}