Hi Bas,

your attachment didn't make it through the mailing list.

Can you point me to where I can download it from?

Thanks
Sven


On 31.01.22 14:51, Bas Gooren wrote:
Hi,

We are experimenting with the JavaScriptDeferHeaderResponse, but out of the box it doesn’t work correctly for us.
We are on wicket 9.7.0.

On an Ajax call (e.g. link click), the response includes a ‘DOMContentLoaded’ event listener (which is not needed there). Since that never fires, any javascript handlers that are in the Ajax response are not registered. Please have a look at the attached Quickstart, which demonstrates the issue.

Once the AJAX link is clicked, this evaluate node is added to the Ajax response (relevant part shown):

document.addEventListener('DOMContentLoaded', function() { (function(){console.log('test');})();(function(){Wicket.Log.enabled=true;})();(function(){Wicket.Ajax.baseUrl="?0";})();(function(){Wicket.Ajax.ajax({"u":"./?0-1.0-ajax","c":"ajax1","e":"click","pd":true});})();(function(){console.log('click');})();; });

The Ajax handler (Wicket.Ajax.ajax()) is inside the DOMContentLoaded event handler.

I’m not sure if we should be using the JavaScriptDeferHeaderResponse differently. We tried registering it using the three different methods provided by the header response decorators collection (add, add pre, add post).

Any help would be appreciated :-)

Met vriendelijke groet,
Kind regards,

Bas Gooren

---------------------------------------------------------------------
To unsubscribe, e-mail:users-unsubscr...@wicket.apache.org
For additional commands, e-mail:users-h...@wicket.apache.org

Reply via email to