You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ComboboxSelectedItemText.java 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package com.vaadin.tests.components.ui;
  2. import com.vaadin.server.VaadinRequest;
  3. import com.vaadin.tests.components.AbstractReindeerTestUIWithLog;
  4. import com.vaadin.ui.ComboBox;
  5. import com.vaadin.ui.Label;
  6. public class ComboboxSelectedItemText extends AbstractReindeerTestUIWithLog {
  7. @Override
  8. protected void setup(VaadinRequest request) {
  9. getLayout().addComponent(new Label(
  10. "Select first ANTIGUA AND BARBUDA from the first combobox. Then select ANTIGUA AND BARBUDA from the second combobox. Finally, click the popup button on the first combobox. Before fix you would see UA AND BAR in the field."));
  11. ComboBox<String> combobox = new ComboBox<>("Text input enabled:");
  12. combobox.setWidth("100px");
  13. combobox.setItems("AMERICAN SAMOA", "ANTIGUA AND BARBUDA");
  14. ComboBox<String> combobox2 = new ComboBox<>("Text input disabled:");
  15. combobox2.setWidth("100px");
  16. combobox2.setTextInputAllowed(false);
  17. combobox2.setItems("AMERICAN SAMOA", "ANTIGUA AND BARBUDA");
  18. getLayout().addComponent(combobox);
  19. getLayout().addComponent(combobox2);
  20. }
  21. @Override
  22. protected String getTestDescription() {
  23. return "Tests selected item is displayed from the beginning";
  24. }
  25. @Override
  26. protected Integer getTicketNumber() {
  27. return 13477;
  28. }
  29. }