Hi,
I'm in the process of migrating our application from Wicket 7.10 to
Wicket 8 and encountered some weirdness with regards to header
contributions.
Our application has a top-level WebPage that defines a
HeaderResponseContainerat the very end of the page markup and all other
application pages inherit from it. We have a few header items that need
to be rendered in their own section at the bottom of the page so I
basically took the approach outlined in
http://tomaszdziurko.com/2017/02/forcing-wicket-place-javascript-files-bottom/
and adopted it to our needs.
Our Application#init() method does this:
-----------------------------------final IHeaderResponseDecorator
headerResponseDecorator =new IHeaderResponseDecorator()
{
@Override public IHeaderResponse decorate(IHeaderResponse response)
{
return new FilteringHeaderResponse(response);
}
};
setHeaderResponseDecorator(headerResponseDecorator);
-----------------------------------
And from inside Behavior#renderHead() we're doing
-----------------------------------final OnDomReadyHeaderItem toWrap =
OnDomReadyHeaderItem.forScript(script);
response.render(new FilteredHeaderItem(toWrap, "our-bucket" );
-----------------------------------
This was working fine in Wicket 7.10 but with Wicket 8 the Wicket
defeault Javascript files (wicket-event-jquery,wicket-ajax-jquery etc.)
are no longer being included in the page so AJAX buttons etc. fail with
"TypeError: Wicket.Event is undefined" etc.
Wrapping the FilteringHeaderResponse inside a ResourceAggregator like||
shown in the migration guide had no effect.
Thanks,
Tobias