use of io.imunity.furms.ui.utils.FormSettings.NAME_MAX_LENGTH in project furms by unity-idm.
the class SitesView method addEditForm.
private Component addEditForm(Editor<SiteGridItem> siteEditor) {
TextField siteNameField = new TextField();
siteNameField.setMaxLength(NAME_MAX_LENGTH);
siteNameField.setWidthFull();
siteNameField.setValueChangeMode(EAGER);
siteEditor.getBinder().forField(siteNameField).withValidator(getNotEmptyStringValidator(), getTranslation("view.sites.form.error.validation.field.name.required")).withValidator(siteName -> !siteService.isNamePresentIgnoringRecord(siteName, siteEditor.getItem().getId()), getTranslation("view.sites.form.error.validation.field.name.unique")).bind(SiteGridItem::getName, SiteGridItem::setName);
return new Div(siteNameField);
}
Aggregations