(Sorry if you're seeing this twice but the apache mail server rejected my
first post.)

I'm upgrading to 1.3 from 1.2.6. I was using the following code to add a
handler for the onbeforeunload event to the body tag:

protected void onAttach()
{
  super.onAttach();

  final WebMarkupContainer c = getWebPage().getBodyContainer()
    .getBodyContainer();
  c.add(new SimpleAttributeModifier("onbeforeunload",
    "return warnOnPageExit('" + getString("formdirtymessage")
      + "');"));
}

>From the migration guide, it looks like this should be the replacement:

public void renderHead(IHeaderResponse response)
{
    response.renderOnEventJavacript("window", "beforeunload",
        "return warnOnPageExit('" + getString("formdirtymessage")
            + "');");
}

However, it doesn't work. The event fires but it's too late to be picked up
by the browser. Any ideas?

Thanks,
Julian

-- 
View this message in context: 
http://www.nabble.com/How-to-use-renderOnEventJavacript%28%29--tf4845924.html#a13864261
Sent from the Wicket - User mailing list archive at Nabble.com.


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

Reply via email to