0 Replies Latest reply on Dec 3, 2009 11:34 AM by trind

    rich:modalPanel hide when hitting browse back button

    trind Newbie

      Hi i use this to disable the page when ajax loads objects to the page.
      However when i leave the page and then hit the back button. The rich:modalPanel is shown and won't automaticly close.

      Anyone got a good soluition to this ?


      var waitDialogShown = false; 

      var useTimerBeforeShowWaitDialog = true; 
      var waitDialogTimeout = 50; 
      var waitDialogTimer; 

      function showWaitDialog() { 

          //avoid attempt to show it if it is already shown 
          if (!waitDialogShown) { 
              waitDialogShown = true; 

      function onRequestStart() { 

          if (useTimerBeforeShowWaitDialog) { 
              waitDialogTimer = setTimeout("showWaitDialog();", waitDialogTimeout); 
          } else { 

      function onRequestEnd() { 

          if (waitDialogShown) { 
                waitDialogShown = false; 
          } else if (useTimerBeforeShowWaitDialog &amp;&amp; waitDialogTimer) { 

      <rich:modalPanel id="wait-dialog" resizeable="false" autosized="false" width="200" height="65" moveable="false" shadowOpacity="0"> 
         <f:facet name="header">#{localization.getTranslation('lea.pleasewait')}</f:facet> 
         <h:outputText value="#{localization.getTranslation('lea.yourrequestisbeeingproccesed')}"/> 
      <a:status onstart="onRequestStart()" onstop="onRequestEnd()"/>