AjaxEventBehavior behavior = new AjaxEventBehavior("keyup"){ @Override protected void onEvent(AjaxRequestTarget target) { System.out.println("Hello world!"); } }; form.add(behavior);
In previous versions of Wicket, I could do it like this:
behavior.setThrottleDelay(Duration.ONE_SECOND);
But since version 6.1 this feature has been erased. And the Internet is full of legacy tutorials that contain .setThrottleDelay () methods.
Basically, the goal is to trigger behavior when a person has stopped typing in a form. Currently, it causes behavior every time INSTANTLY, when a key arises, which basically drops out on the server side. That is why I would like to postpone. Prerequisites: I am currently trying to query the database and get data similar to form input. And all this at a time when a person is typing. But a delay would be necessary in order to keep the server side / SQL out of the "bombardment range".
I am also open to alternatives.
st6mm source share