예제 #1
0
  /** {@inheritDoc} */
  public boolean validateView() {
    if (validator == null && !errors.hasErrors()) return true;

    if (validator != null) validator.validate(getModel(), errors);

    if (errors.hasErrors()) {
      for (FieldError error : errors.getFieldErrors()) {
        for (ErrorProcessor ep : errorProcessors) {
          if (error instanceof ControlError) {
            ControlError ce = (ControlError) error;
            ep.processError(ce.getComponent(), error);
          } else {
            Binder<?> b = binder.getBinder(error.getField());
            if (b instanceof PropertyBinder) {
              ep.processError(((PropertyBinder) b).getComponent(), error);
            }
          }
        }
      }
      return false;
    }
    return true;
  }
예제 #2
0
 private void resetErrorProcessors() {
   for (ErrorProcessor ep : errorProcessors) {
     ep.reset();
   }
 }