0 Replies Latest reply on May 19, 2011 9:39 AM by anicapil

    Onload does not fire using iframe with Safari!

    anicapil

      Hi! This code is working execllent in IE and FF but on safari it does not hide the spinner when process is completed. Can anybody help me out this?

       

      <script type="text/javascript">

       

          var iframe;

       

          function submitExport(id) {

              iframe = document.createElement('iframe');

              iframe.height = 0;

              iframe.width = 0;

              iframe.frameBorder = 0;

              iframe.src = "./export/ExcelServlet?productionId=" + id;

       

              if (navigator.userAgent.indexOf("MSIE") > -1) {

                  iframe.onreadystatechange = function() {

                      if (iframe.readyState == "interactive") {

                          Richfaces.hideModalPanel('loadingPanel');

                      }

                  };

              }

              else {

                  iframe.onload = function() {

                      Richfaces.hideModalPanel('loadingPanel');

                  };

              }

              document.body.appendChild(iframe);

          }

       

         function showSpinner() {

              Richfaces.showModalPanel('loadingPanel');

          }

       

          function hideSpinner() {

              Richfaces.hideModalPanel('loadingPanel');

          }

       

          function confirmDelete() {

              if (confirm('Do you really want to delete the Pic_id List?')) {

                  showSpinner();

                  return true;

              }

              else {

                  return false;

              }

          }

       

      </script>

       

       

       

       

       

       

      <a4j:commandButton id="exportButton"

                                 styleClass="rich-button"

                                 action="#{exportManager.initExport(production)}"

                                 onclick="Richfaces.showModalPanel('loadingPanel');"

                                 oncomplete="submitExport('#{production.productionId}');"

                                 reRender="productionsTable"

                                 value="#{messages.button_exportProduction}"/>

       

          </rich:column>