Search in sources :

Example 1 with PasswordField

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

the class ValueChangeModePage method initView.

private void initView() {
    message = new Div();
    message.setId("message");
    add(message);
    Stream.of(new TextField(), new TextArea(), new PasswordField(), new NumberField(), new EmailField(), new IntegerField(), new BigDecimalField()).forEach(this::setupTestComponent);
}
Also used : Div(com.vaadin.flow.component.html.Div) TextArea(com.vaadin.flow.component.textfield.TextArea) EmailField(com.vaadin.flow.component.textfield.EmailField) TextField(com.vaadin.flow.component.textfield.TextField) IntegerField(com.vaadin.flow.component.textfield.IntegerField) PasswordField(com.vaadin.flow.component.textfield.PasswordField) NumberField(com.vaadin.flow.component.textfield.NumberField) BigDecimalField(com.vaadin.flow.component.textfield.BigDecimalField)

Example 2 with PasswordField

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

the class PasswordFieldTest method clearButtonVisiblePropertyValue.

@Test
public void clearButtonVisiblePropertyValue() {
    PasswordField passwordField = new PasswordField();
    assertClearButtonPropertyValueEquals(passwordField, true);
    assertClearButtonPropertyValueEquals(passwordField, false);
}
Also used : PasswordField(com.vaadin.flow.component.textfield.PasswordField) Test(org.junit.Test)

Example 3 with PasswordField

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

the class PasswordFieldTest method initialValuePropertyValue.

@Test
public void initialValuePropertyValue() {
    PasswordField passwordField = new PasswordField();
    assertEquals(passwordField.getEmptyValue(), passwordField.getElement().getProperty("value"));
}
Also used : PasswordField(com.vaadin.flow.component.textfield.PasswordField) Test(org.junit.Test)

Example 4 with PasswordField

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

the class PasswordFieldTest method setValueNull.

@Test
public void setValueNull() {
    PasswordField passwordField = new PasswordField();
    assertEquals("Value should be an empty string", "", passwordField.getValue());
    thrown.expect(NullPointerException.class);
    thrown.expectMessage("Null value is not supported");
    passwordField.setValue(null);
}
Also used : PasswordField(com.vaadin.flow.component.textfield.PasswordField) Test(org.junit.Test)

Example 5 with PasswordField

use of com.vaadin.flow.component.textfield.PasswordField in project SODevelopment by syampillai.

the class ChangePassword method createPasswordField.

private PasswordField createPasswordField(String caption) {
    PasswordField f = new PasswordField(caption);
    f.setMaxLength(30);
    return f;
}
Also used : PasswordField(com.vaadin.flow.component.textfield.PasswordField)

Aggregations

PasswordField (com.vaadin.flow.component.textfield.PasswordField)13 Test (org.junit.Test)4 Div (com.vaadin.flow.component.html.Div)3 Button (com.vaadin.flow.component.button.Button)2 EmailField (com.vaadin.flow.component.textfield.EmailField)2 TextField (com.vaadin.flow.component.textfield.TextField)2 AuthService (com.example.application.data.services.AuthService)1 MainLayout (com.example.application.views.MainLayout)1 Component (com.vaadin.flow.component.Component)1 Composite (com.vaadin.flow.component.Composite)1 H1 (com.vaadin.flow.component.html.H1)1 NativeButton (com.vaadin.flow.component.html.NativeButton)1 Notification (com.vaadin.flow.component.notification.Notification)1 Alignment (com.vaadin.flow.component.orderedlayout.FlexComponent.Alignment)1 VerticalLayout (com.vaadin.flow.component.orderedlayout.VerticalLayout)1 Select (com.vaadin.flow.component.select.Select)1 BigDecimalField (com.vaadin.flow.component.textfield.BigDecimalField)1 IntegerField (com.vaadin.flow.component.textfield.IntegerField)1 NumberField (com.vaadin.flow.component.textfield.NumberField)1 TextArea (com.vaadin.flow.component.textfield.TextArea)1