On 10/16/05, Arto Arffman <[EMAIL PROTECTED]> wrote:
> I have a component which adds an AjaxHandler in its consturctor:
> ...
>   add(new AjaxHandler() {
>    @Override
>    protected void
> renderHeadContribution(HtmlHeaderContainer container) {
>      container.getResponse().write("... javascript to head-section ...");
>     }
>     }
>   });
> ...
>
> When the page template has <wicket:head> then this javascript is added twice
> into head section. Works ok without <wicket:head>.

I'll test it, but ...
... a PAGE template (not sure you meant it like that) (excluding
inherited page markup as well) must not have a <wicket:head> tag. The
purpose of <wicket:head> is for components to contribute to the page's
<head> tag. Pages don't need that. They simply add directly to <head>.
... Just to add "... javascript to head-section ..." you need no
AjaxHandler IMO. That is exactly what <wicket:head> is about. Just add
what you want to be contributed to <head> to <wicket:head> of your
components markup. Provided the javascript you want to add is static
and doesn't change. But again, this might be again a misunderstanding
due to the "example".

Juergen


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to