// Get client id and init message + key
String clientId = component.getClientId();
- FacesMessage facesMessage = null;
- String requiredMessage;
+ String requiredMessage = null;
// So far all fine, no check if the field is fine
for (final String field : requiredFields) {
requiredMessage = MessageFormat.format("Field {0} is not Boolean: {1}", field, value); //NOI18N
// Value is not right type
- facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR, requiredMessage, requiredMessage); //NOI18N
break;
}
}
// Abort processing here
- facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR, requiredMessage, requiredMessage);
break;
}
}
}
// Is facesMessage set?
- if (null != facesMessage) {
+ if (null != requiredMessage) {
// Abort here
- throw new ValidatorException(facesMessage);
+ throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, requiredMessage, requiredMessage));
}
}