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

Direct iframe removal not supported by Firefox: tab title stays as "Connecting"

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.8.0
    • Fix Version/s: 6.9.0, 7.0.0-M1
    • Component/s: wicket
    • Labels:
      None
    • Environment:
      Wicket 6.8.0, Firefox 21

      Description

      Hi,

      When using the post via iframe feature of Wicket (for multipart Ajax request) with Firefox, the tab title is changed to "Connecting..." and it doesn't get back to the original page title at all, even after the Ajax call returned.

      The iframe is removed in the onload of the iframe ( see
      https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js#L868
      ) and it seems to be problematic for Firefox.

      Looks like there is some literature about it here:
      http://stackoverflow.com/questions/7285866/never-ending-connecting-message-after-ajax-form-submit

      and using a pattern like the following should fix it:
      iframe.onload = function(){
      // Do work with the content of the iframeā€¦

      setTimeout(function()

      { iframe.parentNode.removeChild(iframe); }

      , 0);
      }

      Quickstart coming with a way to reproduce the problem:

      • Launch the application using Start.java;
      • Go to http://localhost:8080/ with Firefox;
      • Upload a file via the Ajax submit button;
      • The tab title stays as "Connecting...".

      Now uncomment the resource replacement line in the WicketApplication file, restart the app and it should work correctly.

      Patch using a setTimeout call coming too.

        Attachments

        1. postInIframe.tar.gz
          72 kB
          Guillaume Smet
        2. wicket-fix-iframe-removal.patch
          0.7 kB
          Guillaume Smet

          Activity

            People

            • Assignee:
              mgrigorov Martin Grigorov
              Reporter:
              gsmet Guillaume Smet
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: