3 Replies Latest reply on Oct 2, 2007 9:54 PM by zacwolfe

    Problem closing ModalPanel

    zacwolfe

      I'm trying to use ModalPanel to block user input whenever there's a potentially long-running ajax call happening. I'm able to display the modal panel initially but when I try to close it after the ajax call is complete I'm getting a JS error here:

      function hideProgressPanel() {
       RichFaces.hideModalPanel('progressPanel');
      }
      


      The error is "Object doesn't support this property or method".

      Thanks in advance



        • 1. Re: Problem closing ModalPanel
          zacwolfe

          Additional info: if I attach javascript to the close button on the panel itself, it works fine:

          <mp:modalPanel ....>
          
          ...
          
          <f:facet name="controls">
           <h:graphicImage value="/images/ico_close.gif" onclick="Richfaces.hideModalPanel('workingPanel');" />
          </f:facet>
          
          ...
          </mp:modalPanel>
          


          Only when I try to call javascript from the parent page do I have a problem.

          • 2. Re: Problem closing ModalPanel

            similar task: http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060361#4060361

            I am just curious. Why you use mp:modalPanel, but not rich:modalPanel?

            Both code snippets have different names for panel. So, I cannot be sure about such banal problem as typo.

            • 3. Re: Problem closing ModalPanel
              zacwolfe

              Thanks for the reply.

              Yes I accidentally entered mismatched names when I typed in the snippet, but (unfortunately) not in my actual code--but good catch.

              Anyway, the link you gave me helped immensely. I wasn't aware of the ajax4jsf status tag, it's exactly what I needed and its working now. I don't know why my javascript call didn't work--I suspect its some kind of JS scoping issue--but at least for now I don't care :-)

              Thanks!