10 Replies Latest reply on Mar 11, 2012 1:37 AM by v.bannur

    Internet Explorer readyState of interactive (not opening ModalPanels)

    timbarlotta

      I am currently working an issue on a web application built using RichFaces.  Every so often (seemingly randomly) the browser will get hung in a "waiting" state.  This occurs in Internet Explorer (7, haven't tested others) only.  I have reduced the pages in the application down to only contain the scripts framework.pack.js and ui.pack.js and it appears that the execution of these scripts are causing the issue (as the issue occurs when the below is all that is sent to the browser.

       

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict/dtd">
      <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
           <title>APP</title>
           <script src="/app/a4j/g/3_3_2.SR1/org/ajax4jsf/framework.pack.js" type="text/javascript"></script>
           <script src="/app/a4j/g/3_3_2.SR1/org/richfaces/ui.pack.js" type="text/javascript"></script>
      </head>
      <body></body>
      </html>
      

       

      It does not occur on every page load, but will occur after reloading the page 5-20 times.  When this occurs the browser is stuck/hung in a readyState of interactive (document.readyState=='interactive').

       

      Once the browser gets in this state everything in the application appears to work fine (when running with actual content not the blank page shown above) except for modalPanels.  These do not show at all.  We have a number of them in the application allowing for "please wait" and "column filtering" modal dialogs.  Looking at modalPanel.js (richfaces-ui.jar:/org/richfaces/renderkit/html/scripts/modalPanel.js) it is obvious why modalPanels are not appearing in IE.

       

      Richfaces.showModalPanel = function(id, opts, event) {
           var invoke = (Richfaces.browser.isIE || Richfaces.browser.isSafari) ?
                function(f) {
                     if(document.readyState != "complete") {
                          // set a timeout for f to be called later (50ms)
                          ...
                     }
                     else {
                          f();
                     }
                }
                :
                function(f) {
                     f();
                };
           var panel = $(id);
           if(!panel) {
                panel = Richfaces.findModalPanel(id);
           }
           invoke(function() { panel.component.show(event, opts);});
      };
      

       

      Since the browser is stuck/hung in "interactive" state the modalPanel is never shown.  I have not determined the location in framework.pack.js or ui.pack.js where the code hangs the browser but I am still searching.  I am hoping someone has some light to shed on this issue.

       

      Some relevant settings: Seam, RichFaces (3.3.2.SR1)

      web.xml: org.richfaces.LoadStyleStrategy=ALL; org.richfaces.LoadScriptStrategy=ALL,org.ajax4jsf.COMPRESS_SCRIPT=false

       

      UPDATE

      I am currently working around the issue by modifying the ui.pack.js file (line 1051)  to allow opening modalPanels when the document is in a readyState of "complete" or "interactive".  This is obviously a hack/workaround and would like to hear of a better fix.