Re: Adding css resource available to all component in the application using wicket 9.x

2021-09-07 Thread Martin Grigorov
Hi,

Instead of dealing with response decorators you could
use org.apache.wicket.markup.html.IHeaderContributor

getHeaderContributorListeners().add( return response -> {
response.render(CssHeaderItem.forReference(css1));
response.render(CssHeaderItem.forReference(css2));
})

IHeaderResponseDecorator is more powerful. It should be used when you want
to intercept all header contributions and add/modify/remove contributions.

On Wed, Sep 8, 2021 at 6:47 AM Arunachalam Sibisakkaravarthi <
arunacha...@mcruncher.com> wrote:

> Hi guys,
> I am doing Wicket migration from 7.x to 9.x
> In Wicket7.x I add css resource as below, it was working
>
> getHeaderResponseDecorators().add(getHeaderResponseDecorator());
>
> private IHeaderResponseDecorator getHeaderResponseDecorator()
> {
> return response -> {
> response.render(CssHeaderItem.forReference(css1));
>
> response.render(CssHeaderItem.forReference(css2));
>
> return new JavaScriptFilteredIntoFooterHeaderResponse(response, "scripts");
> };
>
> whereas the above one doesn't work in Wicket9.x
> Is there any alternative to css and js in init() method of WebApplication?
> so that css/js will be available to all components.
>
>
>
> *Thanks And RegardsSibi.ArunachalammCruncher*
>


Re: Adding css resource available to all component in the application using wicket 9.x

2021-09-07 Thread Francois Meillet
Hi Arunachalam,

Migration From Wicket 7 to 8
setHeaderResponseDecorator(new 
JavaScriptToBodyCustomResponseDecorator("footer"));

Wicket 8
setHeaderResponseDecorator(response -> {
return new ResourceAggregator(new 
JavaScriptFilteredIntoFooterHeaderResponse(response, "footer"));
});

Wicket 9
getHeaderResponseDecorators().add(response -> new CustomResponse(response));

For more details, please see
https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=84804436#MigrationtoWicket8.0-WICKET-6498
and
https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+9.0#MigrationtoWicket9.0-DeprecateAppliation#setHeaderResponseDecorator()ASFJIRAkey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution5aa69414-a9e9-3523-82ec-879b028fb15bWICKET-6729

François


> Le 8 sept. 2021 à 05:47, Arunachalam Sibisakkaravarthi 
>  a écrit :
> 
> Hi guys,
> I am doing Wicket migration from 7.x to 9.x
> In Wicket7.x I add css resource as below, it was working
> 
> getHeaderResponseDecorators().add(getHeaderResponseDecorator());
> 
> private IHeaderResponseDecorator getHeaderResponseDecorator()
> {
>return response -> {
>response.render(CssHeaderItem.forReference(css1));
> 
>response.render(CssHeaderItem.forReference(css2));
> 
> return new JavaScriptFilteredIntoFooterHeaderResponse(response, "scripts");
> };
> 
> whereas the above one doesn't work in Wicket9.x
> Is there any alternative to css and js in init() method of WebApplication?
> so that css/js will be available to all components.
> 
> 
> 
> *Thanks And RegardsSibi.ArunachalammCruncher*


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



Adding css resource available to all component in the application using wicket 9.x

2021-09-07 Thread Arunachalam Sibisakkaravarthi
Hi guys,
I am doing Wicket migration from 7.x to 9.x
In Wicket7.x I add css resource as below, it was working

getHeaderResponseDecorators().add(getHeaderResponseDecorator());

private IHeaderResponseDecorator getHeaderResponseDecorator()
{
return response -> {
response.render(CssHeaderItem.forReference(css1));

response.render(CssHeaderItem.forReference(css2));

return new JavaScriptFilteredIntoFooterHeaderResponse(response, "scripts");
};

whereas the above one doesn't work in Wicket9.x
Is there any alternative to css and js in init() method of WebApplication?
so that css/js will be available to all components.



*Thanks And RegardsSibi.ArunachalammCruncher*