Ahh, AjaxHandler is implementing it. But the question remains.
AjaxHandler is a IBehaviour and not the AjaxHandler IMO should make
the contribution to the header but the component the AjaxHandler is
attached to. I'm not a ajax expert but I thought that ajax responds
just with parts of an HTML page which needs to be re-rendered but the
header stays the same. And even if an ajax response is not HTML it is
some XML schema which the js reader is able to interpret and to make
the DOM changes.
BTW because AjaxHandler implements the interface it basically
duplicates the code which already is implemented for containers to
make sure a header is contributed just once.
Juergen
On 1/20/06, Juergen Donnerstag <[EMAIL PROTECTED]> wrote:
> The code snippet below is execute for each almost every component
> while rendering the <head> section of a page. I wonder this is for.
> And the use case is. What is that any component might contribute to
> <head> or <body onLoad>? Originally the intend was that Panel and
> Border implements the IHeaderContributor interface because here is
> makes senses. <wicket:head> and body tag may contribute to the pages
> header in case the panel requires any javascript, css or onLoad
> initialization.
>
> Any ideas? Otherwise I'll remove it.
>
> Juergen
>
> // get head and body contributions in one loop
> // NOTE: THIS CODE MUST BE IN SYNC WITH SAME PIECE OF CODE in
> WEBMARKUPCONTAINER
> List behaviors = getBehaviors();
> for (Iterator i = behaviors.iterator(); i.hasNext();)
> {
> IBehavior behavior = (IBehavior)i.next();
> if (behavior instanceof IHeaderContributor)
> {
>
> ((IHeaderContributor)behavior).renderHead(container);
> }
>
> if (behavior instanceof IBodyOnLoadContributor)
> {
> String stmt =
> ((IBodyOnLoadContributor)behavior).getBodyOnLoad();
> if (stmt != null)
> {
>
> ((WebPage)getPage()).appendToBodyOnLoad(stmt);
> }
> }
> }
>
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user