/** * Check if the error message should be hidden. * * An empty (null or "") message is invisible unless it contains nested * exceptions that are visible. * * @return true if the error message should be hidden, false otherwise */ public boolean isInvisible() { String msg = getMessage(); if (msg != null && !msg.isEmpty()) { return false; } if (causes != null) { for (InvalidValueException e : causes) { if (!e.isInvisible()) { return false; } } } return true; }
validate(); } catch (Validator.InvalidValueException e) { if (!e.isInvisible()) { validationError = e;
protected Validator.InvalidValueException getValidationError() { if (isEagerValidation() && lastKnownTextChangeValue != null) { return eagerValidationError; } /* * Check validation errors only if automatic validation is enabled. * Empty, required fields will generate a validation error containing * the requiredError string. For these fields the exclamation mark will * be hidden but the error must still be sent to the client. */ Validator.InvalidValueException validationError = null; if (isValidationVisible()) { try { validate(); } catch (Validator.InvalidValueException e) { if (!e.isInvisible()) { validationError = e; } } } return validationError; }
protected Validator.InvalidValueException getValidationError() { if (isEagerValidation() && lastKnownTextChangeValue != null) { return eagerValidationError; } /* * Check validation errors only if automatic validation is enabled. * Empty, required fields will generate a validation error containing * the requiredError string. For these fields the exclamation mark will * be hidden but the error must still be sent to the client. */ Validator.InvalidValueException validationError = null; if (isValidationVisible()) { try { validate(); } catch (Validator.InvalidValueException e) { if (!e.isInvisible()) { validationError = e; } } } return validationError; }