use of com.vaadin.flow.component.textfield.EmailField in project docs by vaadin.
the class CrudItemInitialization method createEditor.
private CrudEditor<Person> createEditor() {
TextField firstName = new TextField("First name");
TextField lastName = new TextField("Last name");
EmailField email = new EmailField("Email");
TextField profession = new TextField("Profession");
FormLayout form = new FormLayout(firstName, lastName, email, profession);
Binder<Person> binder = new Binder<>(Person.class);
binder.forField(firstName).asRequired().bind(Person::getFirstName, Person::setFirstName);
binder.forField(lastName).asRequired().bind(Person::getLastName, Person::setLastName);
binder.forField(email).asRequired().bind(Person::getEmail, Person::setEmail);
binder.forField(profession).asRequired().bind(Person::getProfession, Person::setProfession);
return new BinderCrudEditor<>(binder, form);
}
use of com.vaadin.flow.component.textfield.EmailField in project docs by vaadin.
the class CrudLocalization method createEditor.
private CrudEditor<Person> createEditor() {
TextField firstName = new TextField("First name");
TextField lastName = new TextField("Last name");
EmailField email = new EmailField("Email");
TextField profession = new TextField("Profession");
FormLayout form = new FormLayout(firstName, lastName, email, profession);
Binder<Person> binder = new Binder<>(Person.class);
binder.forField(firstName).asRequired().bind(Person::getFirstName, Person::setFirstName);
binder.forField(lastName).asRequired().bind(Person::getLastName, Person::setLastName);
binder.forField(email).asRequired().bind(Person::getEmail, Person::setEmail);
binder.forField(profession).asRequired().bind(Person::getProfession, Person::setProfession);
return new BinderCrudEditor<>(binder, form);
}
use of com.vaadin.flow.component.textfield.EmailField in project docs by vaadin.
the class CrudOpenEditor method createEditor.
private CrudEditor<Person> createEditor() {
TextField firstName = new TextField("First name");
TextField lastName = new TextField("Last name");
EmailField email = new EmailField("Email");
TextField profession = new TextField("Profession");
FormLayout form = new FormLayout(firstName, lastName, email, profession);
Binder<Person> binder = new Binder<>(Person.class);
binder.forField(firstName).asRequired().bind(Person::getFirstName, Person::setFirstName);
binder.forField(lastName).asRequired().bind(Person::getLastName, Person::setLastName);
binder.forField(email).asRequired().bind(Person::getEmail, Person::setEmail);
binder.forField(profession).asRequired().bind(Person::getProfession, Person::setProfession);
return new BinderCrudEditor<>(binder, form);
}
use of com.vaadin.flow.component.textfield.EmailField in project projecte-dam-v2-equip2 by IESEBRE.
the class RegisterView method initContent.
@Override
protected Component initContent() {
TextField username = new TextField("Nom");
EmailField email = new EmailField("Email");
PasswordField password1 = new PasswordField("Contrasenya");
PasswordField password2 = new PasswordField("Confirmar Contrasenya");
VerticalLayout register = new VerticalLayout(new H1("Crear usuari"), username, email, password1, password2, new Button("Crear", event -> register(username.getValue(), email.getValue(), password1.getValue(), password2.getValue())));
register.setAlignItems(Alignment.CENTER);
return register;
}
use of com.vaadin.flow.component.textfield.EmailField in project flow-components by vaadin.
the class EmailFieldTest method initialValuePropertyValue.
@Test
public void initialValuePropertyValue() {
EmailField emailField = new EmailField();
assertEquals(emailField.getEmptyValue(), emailField.getElement().getProperty("value"));
}
Aggregations