Wicketstuff-core projects are bundled user contributions for use with Apache Wicket (https://wicket.apache.org/). They are released in step with Wicket releases to make them easy to use.
340
stars
297
forks
source link
wicketstuff-input-events - accumulating event listeners on AJAX components #711
When adding an InputBehavior to a component which is updated via AJAX, it can happen that the event listener registered by the InputBehavior is registered over and over again during AJAX updates. This is a resource leak and also can lead to input events being triggered way too often.
I believe a reasonable fix for this behavior would be to update the JS which registers the listener to remove any existing listener for the key binding for which the new listener is created. This is may be as simple as adding a shortcut.remove(keys) before the shortcut.add(keys,...)` call in the template.
When adding an
InputBehavior
to a component which is updated via AJAX, it can happen that the event listener registered by theInputBehavior
is registered over and over again during AJAX updates. This is a resource leak and also can lead to input events being triggered way too often.I believe a reasonable fix for this behavior would be to update the JS which registers the listener to remove any existing listener for the key binding for which the new listener is created. This is may be as simple as adding a
shortcut.remove(keys)
before the shortcut.add(keys,...)` call in the template.