diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2013-02-05 14:32:51 +0000 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-02-05 14:32:51 +0000 |
commit | a90ab60d8f6a7bcdfad46a3d1c323c225d711d68 (patch) | |
tree | f33bed8bfb39ad38f7809bfddd50780cce492158 /uitest/src/com/vaadin | |
parent | 799a969b087771d102d9a3f835ba4d73bc0445ad (diff) | |
parent | a915f6fd1f03efcf7c04dc383d1a076ca46f4b3d (diff) | |
download | vaadin-framework-a90ab60d8f6a7bcdfad46a3d1c323c225d711d68.tar.gz vaadin-framework-a90ab60d8f6a7bcdfad46a3d1c323c225d711d68.zip |
Merge "Merge of (#10766) to Vaadin 7." into 7.0
Diffstat (limited to 'uitest/src/com/vaadin')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/combobox/ComboBoxDuplicateCaption.java | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxDuplicateCaption.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxDuplicateCaption.java new file mode 100644 index 0000000000..3c1e8a27d6 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxDuplicateCaption.java @@ -0,0 +1,66 @@ +package com.vaadin.tests.components.combobox; + +import java.util.ArrayList; +import java.util.List; + +import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.data.util.BeanItemContainer; +import com.vaadin.tests.components.TestBase; +import com.vaadin.tests.util.Log; +import com.vaadin.tests.util.Person; +import com.vaadin.ui.AbstractSelect.ItemCaptionMode; +import com.vaadin.ui.Button; +import com.vaadin.ui.ComboBox; + +public class ComboBoxDuplicateCaption extends TestBase { + + private Log log = new Log(5); + + @Override + protected void setup() { + List<Person> list = new ArrayList<Person>(); + Person p1 = new Person(); + p1.setFirstName("John"); + p1.setLastName("Doe"); + list.add(p1); + + Person p2 = new Person(); + p2.setFirstName("Jane"); + p2.setLastName("Doe"); + list.add(p2); + + BeanItemContainer<Person> container = new BeanItemContainer<Person>( + Person.class); + container.addAll(list); + + ComboBox box = new ComboBox("Duplicate captions test Box"); + box.setId("ComboBox"); + box.setImmediate(true); + box.addValueChangeListener(new ValueChangeListener() { + + public void valueChange( + com.vaadin.data.Property.ValueChangeEvent event) { + Person p = (Person) event.getProperty().getValue(); + log.log("Person = " + p.getFirstName() + " " + p.getLastName()); + } + }); + box.setContainerDataSource(container); + box.setItemCaptionMode(ItemCaptionMode.PROPERTY); + box.setItemCaptionPropertyId("lastName"); + + addComponent(log); + + addComponent(box); + addComponent(new Button("Focus this")); + } + + @Override + protected String getDescription() { + return "VFilterSelects with duplicate item captions should not try to do a select (exact match search) for onBlur if not waitingForFilteringResponse"; + } + + @Override + protected Integer getTicketNumber() { + return 10766; + } +} |