Search in sources :

Example 51 with TextArea

use of com.vaadin.flow.component.textfield.TextArea in project flow-components by vaadin.

the class TextAreaPage method addFocusShortcut.

private void addFocusShortcut() {
    TextArea textArea = new TextArea();
    textArea.setLabel("Press ALT + 1 to focus");
    textArea.addFocusShortcut(Key.DIGIT_1, KeyModifier.ALT);
    textArea.setId("shortcut-field");
    add(textArea);
}
Also used : TextArea(com.vaadin.flow.component.textfield.TextArea)

Example 52 with TextArea

use of com.vaadin.flow.component.textfield.TextArea in project flow-components by vaadin.

the class TextAreaPage method addHelperComponent.

private void addHelperComponent() {
    TextArea field = new TextArea();
    field.setLabel("Helper component should be visible");
    Span span = new Span("Helper Component");
    span.setId("helper-component");
    field.setHelperComponent(span);
    field.setId("helper-component-field");
    NativeButton clearButton = new NativeButton("Clear helper component");
    clearButton.setId("clear-helper-component-button");
    clearButton.addClickListener(event -> field.setHelperComponent(null));
    add(field, clearButton);
}
Also used : NativeButton(com.vaadin.flow.component.html.NativeButton) TextArea(com.vaadin.flow.component.textfield.TextArea) Span(com.vaadin.flow.component.html.Span)

Aggregations

TextArea (com.vaadin.flow.component.textfield.TextArea)52 TextField (com.vaadin.flow.component.textfield.TextField)14 Test (org.junit.jupiter.api.Test)13 Div (com.vaadin.flow.component.html.Div)8 VerticalLayout (com.vaadin.flow.component.orderedlayout.VerticalLayout)6 Test (org.junit.Test)6 Button (com.vaadin.flow.component.button.Button)5 HorizontalLayout (com.vaadin.flow.component.orderedlayout.HorizontalLayout)5 Checkbox (com.vaadin.flow.component.checkbox.Checkbox)4 FormLayout (com.vaadin.flow.component.formlayout.FormLayout)4 H3 (com.vaadin.flow.component.html.H3)3 EmailField (com.vaadin.flow.component.textfield.EmailField)3 NumberField (com.vaadin.flow.component.textfield.NumberField)3 ValueChangeEvent (com.vaadin.flow.component.HasValue.ValueChangeEvent)2 ResponsiveStep (com.vaadin.flow.component.formlayout.FormLayout.ResponsiveStep)2 H2 (com.vaadin.flow.component.html.H2)2 NativeButton (com.vaadin.flow.component.html.NativeButton)2 StringLengthValidator (com.vaadin.flow.data.validator.StringLengthValidator)2 Route (com.vaadin.flow.router.Route)2 EFieldTypeDefinition (ch.akros.marketplace.administration.constants.EFieldTypeDefinition)1