The property id must not be already used in the form.
This field is added to the layout using the {@link #attachField(Object,Field)} method.
3839404142434445464748
public boolean isValid(Object value) { return field1.getValue().equals("valid"); } }); form.addField("Field 1", field1); layout.addComponent(form); getMainWindow().addWindow(subWindow); subWindow.bringToFront(); }
5455565758596061626364
@Override public void focus() { secondFieldIsFocused[0] = true; } }; form.addField("a", field1); form.addField("b", field2); form.focus(); Assert.assertTrue("Field with enabled connector is not focused", secondFieldIsFocused[0]);
5556575859606162636465
public void focus() { secondFieldIsFocused[0] = true; } }; form.addField("a", field1); form.addField("b", field2); form.focus(); Assert.assertTrue("Field with enabled connector is not focused", secondFieldIsFocused[0]); Assert.assertFalse("Field with disabled connector is focused",
8788899091929394959697
field.addValidator(new AlwaysFailValidator()); } } }; form.addField("Field", new TextField("Text")); form.addField("Date", new DateField("Date")); // not good for automated testing with screenshots when null // form.addField("Inline Date", new InlineDateField("Date")); // same as basic DateField // form.addField("Popup Date", new PopupDateField("Date"));
8889909192939495969798
} } }; form.addField("Field", new TextField("Text")); form.addField("Date", new DateField("Date")); // not good for automated testing with screenshots when null // form.addField("Inline Date", new InlineDateField("Date")); // same as basic DateField // form.addField("Popup Date", new PopupDateField("Date")); Button setDateButton = new Button("Set date");
104105106107108109110111112113114
form.getField("Date").setValue(new Date(0)); } }); NativeSelect nativeSelect = new NativeSelect("NativeSelect"); form.addField("Native Select", nativeSelect); nativeSelect.addItem("Value 1"); // in #4103, the Select component was behaving differently from others form.addField("Select", new Select("Select"));
108109110111112113114115116117118
NativeSelect nativeSelect = new NativeSelect("NativeSelect"); form.addField("Native Select", nativeSelect); nativeSelect.addItem("Value 1"); // in #4103, the Select component was behaving differently from others form.addField("Select", new Select("Select")); Select select2 = new Select("Select 2"); select2.addItem("Value 1"); form.addField("Select 2", select2);
112113114115116117118119120121122
// in #4103, the Select component was behaving differently from others form.addField("Select", new Select("Select")); Select select2 = new Select("Select 2"); select2.addItem("Value 1"); form.addField("Select 2", select2); OptionGroup optionGroup = new OptionGroup("OptionGroup"); optionGroup.setMultiSelect(false); optionGroup.addItem("Option 1"); optionGroup.addItem("Option 2");
118119120121122123124125126127128
OptionGroup optionGroup = new OptionGroup("OptionGroup"); optionGroup.setMultiSelect(false); optionGroup.addItem("Option 1"); optionGroup.addItem("Option 2"); form.addField("Option Group 1", optionGroup); OptionGroup optionGroup2 = new OptionGroup("OptionGroup"); optionGroup2.setMultiSelect(true); optionGroup2.addItem("Option 1"); optionGroup2.addItem("Option 2");
124125126127128129130131132133134
OptionGroup optionGroup2 = new OptionGroup("OptionGroup"); optionGroup2.setMultiSelect(true); optionGroup2.addItem("Option 1"); optionGroup2.addItem("Option 2"); form.addField("Option Group 2", optionGroup2); // TODO could add more different fields return form; }