// Pre-validation (example: not null, not a string, empty string ...)
super.preValidate(context, component, value, requiredFileds, false);
+ // Cast value
+ Long number = (Long) value;
+
+ // Get status
+ Boolean ifUserExists = this.userBean.ifUserIdExists(number);
+
// Is the address book id valid?
- if (!this.userBean.ifUserIdExists((Long) value)) {
+ if (!ifUserExists) {
// Is not valid
- throw new ValidatorException(new FacesMessage(MessageFormat.format("No user found with id {0}. Please check your link.", value))); //NOI18N
+ throw new ValidatorException(new FacesMessage(MessageFormat.format("No user found with id {0}. Please check your link.", number))); //NOI18N
}
// Trace message