Search in sources :

Example 76 with TextField

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));
}
Also used : TextField(com.vaadin.ui.TextField) Test(org.junit.Test)

Example 77 with TextField

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;
}
Also used : TextField(com.vaadin.ui.TextField)

Example 78 with TextField

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;
}
Also used : TextField(com.vaadin.ui.TextField)

Example 79 with TextField

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()));
}
Also used : TextField(com.vaadin.ui.TextField) UITextField(org.linkki.core.ui.section.annotations.UITextField) Component(com.vaadin.ui.Component) Test(org.junit.Test)

Example 80 with TextField

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;
}
Also used : TextField(com.vaadin.ui.TextField)

Aggregations

TextField (com.vaadin.ui.TextField)85 Test (org.junit.Test)22 Button (com.vaadin.ui.Button)17 Label (com.vaadin.ui.Label)17 HorizontalLayout (com.vaadin.ui.HorizontalLayout)13 VerticalLayout (com.vaadin.ui.VerticalLayout)10 ComboBox (com.vaadin.ui.ComboBox)9 GridLayout (com.vaadin.ui.GridLayout)7 SplitTextField (au.com.vaadinutils.crud.splitFields.SplitTextField)6 InvalidValueException (com.vaadin.data.Validator.InvalidValueException)6 ClickListener (com.vaadin.ui.Button.ClickListener)6 ClickEvent (com.vaadin.ui.Button.ClickEvent)5 Panel (com.vaadin.ui.Panel)5 PasswordField (com.vaadin.ui.PasswordField)5 Date (java.util.Date)5 HashMap (java.util.HashMap)5 CheckBox (com.vaadin.ui.CheckBox)4 Form (com.vaadin.ui.Form)4 FormLayout (com.vaadin.ui.FormLayout)4 TextArea (com.vaadin.ui.TextArea)4