// convert value and check if it is in range
value = convert(newValue);
} catch (Exception e) {
setValid(false);
FacesMessage mess = new FacesMessage(label + ": " + e.getLocalizedMessage());
mess.setSeverity(FacesMessage.SEVERITY_ERROR);
context.addMessage(this.getClientId(context), mess);
}
if (value != null) {
if ((null == minValue) || (null == maxValue)) {
setValid(false);
FacesMessage mess = new FacesMessage(label + ": conversation error, maxValue or minValue is null!");
mess.setSeverity(FacesMessage.SEVERITY_ERROR);
context.addMessage(this.getClientId(context), mess);
} else if (minValue.doubleValue() > value.doubleValue()) {
setValid(false);
FacesMessage mess = new FacesMessage(label + ": input value is less than minimal value!");
mess.setSeverity(FacesMessage.SEVERITY_ERROR);
context.addMessage(this.getClientId(context), mess);
} else if (maxValue.doubleValue() < value.doubleValue()) {
setValid(false);
FacesMessage mess = new FacesMessage(label + ": input value is more than maximum value!");
mess.setSeverity(FacesMessage.SEVERITY_ERROR);
context.addMessage(this.getClientId(context), mess);
}
} else {
setValid(false);
FacesMessage mess = new FacesMessage(label + ": input value can't be null!");
mess.setSeverity(FacesMessage.SEVERITY_ERROR);
context.addMessage(this.getClientId(context), mess);
}
}
super.validateValue(context, newValue);