On Wed, Oct 16, 2024 at 11:37 AM Korbinian Bachl <korbinian.ba...@whiskyworld.de.invalid> wrote:
> Ah ok, understood. > > Is there any way to have it working *if* there is a body containing e.g.: > <wicket:container wicket:id="js-footer-container">wicket:container> ? > > If I do it this way: > > getHeaderResponseDecorators().add(response -> { > return new > JavaScriptFilteredIntoFooterHeaderResponse(response, "js-footer-container"); > }); > > it is for *every* page, even the ones that dont have it :( > > So image I have 3 pages that have it, but also 300 that haven't Same answer as before: you could but probably you should not! In #onInitialize() you have access to the markup (the html template) for any MarkupContainer. You can use it to decide whether to add components or not. > > > > ----- Ursprüngliche Mail ----- > > Von: "Martin Grigorov" > > An: "users" <users@wicket.apache.org> > > Gesendet: Mittwoch, 16. Oktober 2024 10:16:53 > > Betreff: Re: wicket ajax-script location > > > On Wed, Oct 16, 2024 at 9:47 AM Korbinian Bachl > > wrote: > > > >> Thanks a lot! > >> > >> However, here I would have to touch the pages + html to have a > >> <wicket:container wicket:id="someId"/> > >> at the bottom of the page. > >> > >> Is there any way how I can make this on a global level for any page just > >> right before the body> tag closing happens (without touching any html)? > >> > > > > You could! > > But I would not do it! > > You could manipulate the MarkupStream or use a custom > > IMarkupResourceStreamProvider, or ... But this would be way too > > complicated! > > The best way is to use a base/parent page that does it for all > > specializations. > > > > > > > >> > >> > >> > >> ----- Ursprüngliche Mail ----- > >> > Von: "Martin Grigorov" > >> > An: "users" <users@wicket.apache.org> > >> > Gesendet: Mittwoch, 16. Oktober 2024 08:15:09 > >> > Betreff: Re: wicket ajax-script location > >> > >> > On Wed, Oct 16, 2024 at 9:00 AM Korbinian Bachl > >> > wrote: > >> > > >> >> Hi, > >> >> > >> >> when using anything AJAX wicket will generate some inline scripts in > the > >> >> header like this: > >> >> > >> >> <script type="text/javascript"> > >> >> /*>> Wicket.Event.add(window, "domready", function(event) { > >> >> Wicket.Ajax.ajax({"u":"https://www.domain.com/url.. > >> .","m":"POST","c":"ajaxSearchField","e":"keyup"});; > >> >> > >> >> ... > >> >> Wicket.Event.publish(Wicket.Event.Topic.AJAX_HANDLERS_BOUND); ;}); > >> /*]]>*/ > >> >> > >> >> How can this be put into the bottom of the body right before the > closing > >> >> body >-Tag ? > >> > > >> > > >> > > >> > https://nightlies.apache.org/wicket/guide/10.x/single.html#_put_javascript_inside_page_body > >> > > >> > > >> >> > >> >> > >> >> > >> >> Best, > >> >> > >> >> KB > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > >> For additional commands, e-mail: users-h...@wicket.apache.org > >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >