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.

ComboBoxNoTextInput.java 780B

12345678910111213141516171819202122232425
  1. package com.vaadin.tests.components.combobox;
  2. import com.vaadin.server.VaadinRequest;
  3. import com.vaadin.ui.CheckBox;
  4. public class ComboBoxNoTextInput extends ComboBoxSelecting {
  5. @Override
  6. protected void setup(VaadinRequest request) {
  7. super.setup(request);
  8. comboBox.setTextInputAllowed(true);
  9. final CheckBox textInputCheckBox = new CheckBox("Text Input", true);
  10. textInputCheckBox.setId("textInput");
  11. textInputCheckBox.addValueChangeListener(event -> comboBox
  12. .setTextInputAllowed(textInputCheckBox.getValue()));
  13. addComponent(textInputCheckBox);
  14. }
  15. @Override
  16. protected String getTestDescription() {
  17. return "ComboBox should open popup on click when text input is not allowed.";
  18. }
  19. }