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);
}
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);
}
Aggregations