use of com.vaadin.flow.component.textfield.PasswordField in project flow-components by vaadin.
the class PasswordFieldPage method addInvalidCheck.
private void addInvalidCheck() {
final PasswordField field = new PasswordField();
field.setMaxLength(10);
field.setMinLength(5);
TextFieldTestPageUtil.addInvalidCheck(this, field);
}
use of com.vaadin.flow.component.textfield.PasswordField in project flow-components by vaadin.
the class PasswordFieldPage method addBasicField.
private void addBasicField() {
Div message = new Div();
PasswordField passwordField = new PasswordField();
passwordField.setLabel("Password field label");
passwordField.setPlaceholder("placeholder text");
passwordField.addValueChangeListener(event -> message.setText(String.format("Password field value changed from '%s' to '%s'", event.getOldValue(), event.getValue())));
NativeButton button = new NativeButton("Toggle eye icon", event -> {
passwordField.setRevealButtonVisible(!passwordField.isRevealButtonVisible());
});
passwordField.setId("password-field-with-value-change-listener");
message.setId("password-field-value");
button.setId("toggle-button");
add(button, passwordField, new ValueChangeModeButtonProvider(passwordField).getValueChangeModeRadios(), message);
}
use of com.vaadin.flow.component.textfield.PasswordField in project flow-components by vaadin.
the class PasswordFieldPage method addFocusShortcut.
private void addFocusShortcut() {
PasswordField passwordField = new PasswordField();
passwordField.setLabel("Press ALT + 1 to focus");
passwordField.addFocusShortcut(Key.DIGIT_1, KeyModifier.ALT);
passwordField.setId("shortcut-field");
add(passwordField);
}
Aggregations