summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/tickets/Ticket5053.java
diff options
context:
space:
mode:
Diffstat (limited to 'uitest/src/com/vaadin/tests/tickets/Ticket5053.java')
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket5053.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket5053.java b/uitest/src/com/vaadin/tests/tickets/Ticket5053.java
new file mode 100644
index 0000000000..6f8ade15c4
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket5053.java
@@ -0,0 +1,35 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.UI.LegacyWindow;
+
+/**
+ * #5053: Last ComboBox item may not be shown if null selection enabled
+ */
+public class Ticket5053 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow main = new LegacyWindow();
+ setMainWindow(main);
+
+ ComboBox combobox = new ComboBox("My ComboBox");
+
+ // Enable null selection
+ combobox.setNullSelectionAllowed(true);
+ // Add the item that marks 'null' value
+ String nullitem = "-- none --";
+ combobox.addItem(nullitem);
+ // Designate it was the 'null' value marker
+ combobox.setNullSelectionItemId(nullitem);
+
+ // Add some other items
+ for (int i = 0; i < 10; i++) {
+ combobox.addItem("Item " + i);
+ }
+
+ main.addComponent(combobox);
+ }
+
+}