SEBSERV-122 fixed

This commit is contained in:
anhefti 2020-04-22 16:43:39 +02:00
parent 18280173c0
commit c56d3a1bd7

View file

@ -93,27 +93,29 @@ final class SebExamConfigImportPopup {
final PageContext context = formHandle.getContext(); final PageContext context = formHandle.getContext();
// Ad-hoc field validation // Ad-hoc field validation
formHandle.process(name -> true, Form.FormFieldAccessor::resetError); if (newConfig) {
final String fieldValue = form.getFieldValue(Domain.CONFIGURATION_NODE.ATTR_NAME); formHandle.process(name -> true, Form.FormFieldAccessor::resetError);
if (StringUtils.isBlank(fieldValue)) { final String fieldValue = form.getFieldValue(Domain.CONFIGURATION_NODE.ATTR_NAME);
form.setFieldError( if (StringUtils.isBlank(fieldValue)) {
Domain.CONFIGURATION_NODE.ATTR_NAME, form.setFieldError(
pageService Domain.CONFIGURATION_NODE.ATTR_NAME,
.getI18nSupport() pageService
.getText(new LocTextKey("sebserver.form.validation.fieldError.notNull"))); .getI18nSupport()
return false; .getText(new LocTextKey("sebserver.form.validation.fieldError.notNull")));
} else if (fieldValue.length() < 3 || fieldValue.length() > 255) { return false;
form.setFieldError( } else if (fieldValue.length() < 3 || fieldValue.length() > 255) {
Domain.CONFIGURATION_NODE.ATTR_NAME, form.setFieldError(
pageService Domain.CONFIGURATION_NODE.ATTR_NAME,
.getI18nSupport() pageService
.getText(new LocTextKey("sebserver.form.validation.fieldError.size", .getI18nSupport()
null, .getText(new LocTextKey("sebserver.form.validation.fieldError.size",
null, null,
null, null,
3, null,
255))); 3,
return false; 255)));
return false;
}
} }
if (fieldControl instanceof FileUploadSelection) { if (fieldControl instanceof FileUploadSelection) {