You must have ValueChangeListener property in your "InputText" tag.
In your method, declared as listener you have ValueChangeEvent object wich contains old value. You can do something like this:
public void myValChanged(ValueChangeEvent event) {
try {
validate(event.getNewValue());
myValue = event.getNewValue();
} catch (Exception ex) {
/*
Listeners are called before update model values in the request lifecycle so any changes you make in that phase are overwritten by the actual values in the page.
By changing the event's phase to UPDATE_MODEL_VALUES or INVOKE_APPLICATION your changes will overwrite those currently set in the page, which is what you need.
*/
myValue = event.getOldValue();
if (!event.getPhaseId().equals(PhaseId.INVOKE_APPLICATION)) {
event.setPhaseId(PhaseId.INVOKE_APPLICATION);
event.queue();
return;
}
}
}
The idea with PhaseId operations is - not to allow your ValueChangeListener override your
variable set "myValue = event.getOldValue();
"