Thanks for the link, Eelco. I haven't had that particular problem with
window.onload. I guess maybe OnLoadContributor isn't the best description of
the solution to the issue, because the name suggests <body onload="..."> or
window.onload. The problem is more how to handle script initializers for
components/behaviors in a way that will work for both page requests and ajax
requests. HeaderContributor is a  marvelous piece of technology, especially
the way it works seamlessly with both request types. Maybe FooterContributor
is a better term, because what I am really after is a HeaderContributor for
the bottom of the page. Thanks for the input, though. I am more than willing
to try my hand at a patch, if you guys think it is suitable for wicket and
has a chance to be adopted. I just want to be sure there is not something I
am overlooking.

jim

On 11/10/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:

On 11/10/06, James McLaughlin <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I have a need for an interface that is a twin to IHeaderContributor, but
> which will contribute javascript to be executed after the html has been
> rendered on the client. I realize all the hooks are there with
> WebPage.getBodyContainer().addOnLoadModifier(), and
> AjaxRequestTarget.appendJavascript(), but this requires the
> component/behavior to know what the current RequestTarget is.

Did you try this http://dean.edwards.name/weblog/2005/09/busted/ ?
That looks like an elegant solution to me, if it works.

*If* that works, we could make that the basis of OnLoadContributor. If
it doesn't, well, we could create an OnLoadContributor that appends at
the end of the rendered page. Anyone knows whether that can result in
additional problems (I can't think of any)?

Personally, I think and OnLoadContributor that works much like
HeaderContributor would be a lot nicer than the current pattern we
have.

Eelco




--
Jim McLaughlin
Director, Software Engineering
Stonewater Control Systems
http://www.stonewatercontrols.com
(o) 847.864.1060 x107
(c) 773.416.0994

Reply via email to