use of com.vaadin.ui.TextField in project linkki by linkki-framework.
the class UIIntegerFieldIntegrationTest method testSetValueWithPrimitiveIntInModelObject_IllegalNumbers.
@Test
public void testSetValueWithPrimitiveIntInModelObject_IllegalNumbers() {
TestModelObjectWithPrimitiveInteger modelObject = new TestModelObjectWithPrimitiveInteger();
TextField textField = createFirstComponent(modelObject);
assertThat(textField.isReadOnly(), is(false));
textField.setValue("asd");
assertThat(modelObject.getValue(), is(0));
}
use of com.vaadin.ui.TextField in project linkki by linkki-framework.
the class ComponentFactory method newReadOnlyTextField100PctWidth.
public static TextField newReadOnlyTextField100PctWidth(String value) {
TextField field = newReadOnlyTextField(value);
field.setWidth("100%");
return field;
}
use of com.vaadin.ui.TextField in project linkki by linkki-framework.
the class ComponentFactory method newTextfield.
public static TextField newTextfield() {
TextField tf = new TextField();
tf.setNullRepresentation("");
tf.setNullSettingAllowed(true);
return tf;
}
use of com.vaadin.ui.TextField in project linkki by linkki-framework.
the class DynamicFieldBindingTest method testDynamicField_shouldBindToTextField.
@Test
public void testDynamicField_shouldBindToTextField() {
String value = "value";
Pmo pmo = new Pmo(new Model(value, false));
Component component = TestUiUtil.createFirstComponentOf(pmo);
assertNotNull(component);
assertTrue(component instanceof TextField);
TextField txt = (TextField) component;
assertThat(txt.getValue(), is(value));
String newValue = "new value";
txt.setValue(newValue);
assertThat(pmo.model.paymentMethod, is(newValue));
pmo.model.paymentMethod = null;
assertThat(txt.getValue(), is(nullValue()));
}
use of com.vaadin.ui.TextField in project linkki by linkki-framework.
the class AddressFields method createTextField.
private static TextField createTextField(String caption) {
TextField tf = new TextField(caption);
tf.setNullRepresentation("");
return tf;
}
Aggregations