// Compare value's type
if (!(value instanceof Boolean)) {
// Generate message
- requiredMessage = MessageFormat.format("Field {0} is not Boolean.", field); //NOI18N
+ 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
// Is it the same?
if (clientId.endsWith(field)) {
// Compare value's type
- if (!(value instanceof Long)) {
+ if ((!allowNull) && (!(value instanceof Long))) {
// Generate message
- requiredMessage = MessageFormat.format("Field {0} is not Long.", field); //NOI18N
+ requiredMessage = MessageFormat.format("Field {0} is not Long.: {1}", field, value); //NOI18N
// Value is not right type
facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR, requiredMessage, requiredMessage); //NOI18N
// Is it the same?
if (clientId.endsWith(field)) {
// Compare value's type
- if (!(value instanceof String)) {
+ if ((!allowNull) && (!(value instanceof String))) {
// Value is empty
- facesMessage = new FacesMessage(MessageFormat.format("Field {0} is not set to String.", field)); //NOI18N
+ facesMessage = new FacesMessage(MessageFormat.format("Field {0} is not String: {1}", field, value)); //NOI18N
}
// Cast to string