Я делаю проверку на стороне клиента GWT, и у меня есть проблема, как показать ошибки проверки, которые возвращаются валидатором. Я его отлазил и вижу, что набор содержит ошибки, но драйвер их не показывает. Используется SimpleBeanEditorDriver.
Entry Entry = driver.flush();
Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
Set<ConstraintViolation<Entry>> violations = validator.validate(Entry, Default.class);
if (violations.size() > 0) {
driver.setConstraintViolations(new ArrayList<ConstraintViolation<?>>(violations));
...
}
Протестировано на GWT вер. 2.4 и 2.5
Код написан в соответствии с https://developers.google.com/web-toolkit/doc/latest/DevGuideValidation, но они не используют редакторы.
Кто-нибудь заставляет его работать вместе с проверкой GWT и редакторами? Может быть, кто-нибудь может дать ссылки на хорошие примеры этого? Я не нашел рабочих. Любая помощь приветствуется!
HasEditorErrors
редактор? - person Thomas Broyer   schedule 26.10.2012HasEditorErrors
(только встроенный редакторValueBoxEditorDecorator
), то нет ничего, что могло бы обрабатывать ошибки, чтобы (возможно) отображать их.RequestFactoryEditorDriver
не исключение. - person Thomas Broyer   schedule 26.10.2012