final LegacyWindow main = new LegacyWindow("#1804");
setMainWindow(main);
com.vaadin.ui.Select s;
s = new Select("Select with null selection allowed; required=true");
s.setNullSelectionAllowed(true);
s.setRequired(true);
listOfAllFields.add(s);
s = new Select("Select with null selection NOT allowed; required=true");
s.setNullSelectionAllowed(false);
s.setRequired(true);
listOfAllFields.add(s);
s = new Select("Testcase from the ticket #1804");
s.setNullSelectionAllowed(false);
s.setPropertyDataSource(new MethodProperty<String>(new TestPojo(), "id"));
s.addValidator(new EmptyStringValidator(
"Selection required for test-field"));
s.setRequired(true);
listOfAllFields.add(s);
s = new Select("Testcase from the ticket #1804, but without validator");
s.setNullSelectionAllowed(false);
s.setPropertyDataSource(new MethodProperty<String>(new TestPojo(), "id"));
s.setRequired(true);
listOfAllFields.add(s);
s = new Select(
"Testcase from the ticket #1804, but with required=false");
s.setNullSelectionAllowed(false);
s.setPropertyDataSource(new MethodProperty<String>(new TestPojo(), "id"));
s.addValidator(new EmptyStringValidator(
"Selection required for test-field"));
listOfAllFields.add(s);
s = new Select(
"Testcase from the ticket #1804, but without validator and with required=false");
s.setNullSelectionAllowed(false);
s.setPropertyDataSource(new MethodProperty<String>(new TestPojo(), "id"));
listOfAllFields.add(s);
s = new Select(
"Required=true, custom error message, null selection not allowed");
s.setRequired(true);
s.setNullSelectionAllowed(false);
s.setPropertyDataSource(new MethodProperty<String>(new TestPojo(), "id"));
s.setValue(null);