Resources are not added if component is created via IComponentResolver

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Resources are not added if component is created via IComponentResolver


I'm working with Wicket 1.4.17.

I've created a component for adding jQuery beauty tips dynamically (called ExtLabel): for example, if label key is fooBar and there exists key in resource bundle a jQuery beauty tip is added dynamically near the label.

It works fine (including ajax requests) when component is being created in the wicket page. But I want functionality similar to wicket:message tag - if there is no component explicitly created in the page it is created by custom IComponentResolver. Via IComponentResolver the component is created OK, but header resources that are added in the constructor are not contributed to the header (for explicit component creation in the page resources are added correctly).

Resources added:

add(JavascriptPackageResource.getHeaderContribution(WicketEventReference.class, "wicket-event.js"));
add(JavascriptPackageResource.getHeaderContribution(WicketAjaxReference.class, "wicket-ajax.js"));
add(JavascriptPackageResource.getHeaderContribution(this.getClass(), ""));
add(JavascriptPackageResource.getHeaderContribution(this.getClass(), "ExtLabel.js"));

Is it a bug or components created from IComponentResolver have limitation for header contribution?

Thanks for any help.