if I were you i'd use the gmap2 contrib...

Zach Cox wrote:
I'm using markup inheritance to reuse a base page template for all
pages on my site.  Some of these pages include Google Maps.  According
to  best practices, the <body> element of the page needs an onunload
event handler that calls the GUnload() function to eliminate memory
leaks:

http://code.google.com/apis/maps/documentation/introduction.html#LoadingMap

I can't put this on the body element of the base page, since only a
few pages need it.  I tried adding a BodyTagAttributeModifier in the
child page constructor but it did absolutely nothing to the body
element:

add(new BodyTagAttributeModifier("onunload", true, new
Model("GUnload();"), this));

I understand the proper way to call onload Javascript is to use
IHeaderResponse.renderOnLoadJavasript() but there's nothing for
onunload.  Is there any way for a child page to dynamically add an
onunload attribute to the page's body element?

Thanks,
Zach

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to