we no longer treat body tags differently, so if you want add a
transparent markupcontainer to your basepage and attach it to your
body tags. then add attribute modifiers to that container.

with the advancement of javascript event handlers people dont use the
body tag for this purpose any longer. also we did have support for
this in the headercontributor but the unload events are very shoddy
and so we decided not to provide it since we did not want to be
bombarded with "why does my onunload event dosnt fire" emails. unload
events are problematic because some browsers dont implement at all,
others only if you navigate a certain way, etc, etc.

-igor


On Sat, Mar 29, 2008 at 11:46 AM, Zach Cox <[EMAIL PROTECTED]> wrote:
>
>  Seriously?  There's no AttributeModifier I can use to add an onunload
>  attribute to body element?
>
>  If not, is it just a matter of "it hasn't been implemented"?  Or is there
>  some philosophical reason it isn't available?
>
>  Thanks,
>  Zach
>
>
>
>
>
>  igor.vaynberg wrote:
>  >
>  > body onunload="if (GUnload!='undefined') GUnload();"
>  >
>  > -igor
>  >
>  >
>  > On Sat, Mar 29, 2008 at 10:51 AM, Zach Cox <[EMAIL PROTECTED]> 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]
>  >>
>  >>
>  >
>  > ---------------------------------------------------------------------
>  > To unsubscribe, e-mail: [EMAIL PROTECTED]
>  > For additional commands, e-mail: [EMAIL PROTECTED]
>  >
>  >
>  >
>
>  --
>  View this message in context: 
> http://www.nabble.com/%3Cbody-onunload%3D%22GUnload%28%29%22%3E-for-Google-Maps-in-child-pages-tp16372664p16373185.html
>  Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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

Reply via email to