The component is connected by binding the value to the bean property.
<h:inputText id="number" value="#{backingBean.number}" validator="#{backingBean.validateNumber}" />
In the verification method, the number value changes
public void validateNumber(FacesContext facesContext, UIComponent component, Object value) {
String inputValue = (String) value;
if (inputValue.length() == 9) {
inputValue = "0" + inputValue;
((UIInput) component).setSubmittedValue(inputValue);
((UIInput) component).setValue(inputValue);
setNumber(inputValue);
}
}
During debugging, I can verify that the value is actually changing, but at the rendering stage, the new value is somehow overridden by the old value. This should have something to do with me, not understanding the JSF life cycle, but the way I see it, I change both the value of the op property to which the component is bound in the user interface, and because I have a binding to the real one component, I also change the value of the component and submitValue to be sure (to find the problem), and yet the change does not affect the int UI?
Any ideas?