Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-664

Allow users to hook into onbeforeunload event so they can tell when a page is closed in the browser

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 1.3.0-beta2
    • wicket
    • None

    Description

      IHeaderResponse should have a method:
      public void renderOnBeforeUnloadJavascript(String javascript);

      Such that you can go:
      add(new AbstractDefaultAjaxBehavior() {

      public void renderHead(IHeaderResponse response)

      { super.renderHead(response); response.renderOnBeforeUnloadJavascript( getCallbackScript(false).toString() ); }

      protected void respond(AjaxRequestTarget target)

      { // Do stuff here. }

      });

      Attachments

        Activity

          People

            almaw Alastair Maw
            almaw Alastair Maw
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: