I have a TextField
where I have added an AjaxFormComponentUpdatingBehavior
to get the current value when user write some string.
filterByObject = new TextField<String>("filterByObject", true, new PropertyModel<String>(searchParams, "objectFilter"));
AjaxFormComponentUpdatingBehavior changeFilterBinded = new AjaxFormComponentUpdatingBehavior ("onkeyup") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
target.addComponent(componentToUpdate);
}
};
filterByObject.add(changeFilterBinded);
When I put some chars inside textfield
, onUpdate
method is correctly called and my component, based on the current state of searchParams
, changes correctly.
Unfortunally when I use Backspace to cancel what I have inserted, the onUpdate
is not called.
I tried changing event (onkeypress
, onkeydown
, onchange
etc...) but it doesn't work. Only onChange
works but I have to change focus to another component.
How can I save the day?