5 Replies Latest reply on Jul 6, 2007 6:38 AM by ilya_shaikovsky

    modal panel problem - "ModalPanel is undefined"

      Hello there,

      I have been using the modal panel successfully, but have just come across an untraceable (for me at least!) error. In IE, if I leave a page that is using the modal panel using a bog-standard navigation rule I get 'ModalPanel is undefined' in the javascript error log. or 'ModalPanel is not defined' in firefox. The modal panel displays as I would expect other than the header has disappeared (on only one page) and in the debug I get 'No streamable resources found for request: 52 resourceUri: 52/header.css'.

      I have moved the panel out of the main form as I need to submit data within it and it has been working without an issue until now. Can anybody steer me in the right direction? Am I doing something wrong? I'm using the snapshot version '3.0.1-20070424.001123-35'.

      Any ideas please anybody?

        • 1. Re: modal panel problem -
          ilya_shaikovsky

          It will be usefull to see your page and get info about versions JSF/ RF you've used.

          And do not forget to try the latest library version.

          
           <ui:define name="body">
           <f:verbatim>
           <a href="javascript:Richfaces.showModalPanel('_panel',{left:'auto', top:'auto'})">
           Show Modal Panel
           </a>
           </f:verbatim>
           <rich:modalPanel id="_panel">
           <f:facet name="header">
           <h:outputText value="test"></h:outputText>
           </f:facet>
           <h:form id="mpform">
           <a4j:outputPanel ajaxRendered="true">
           <h:messages id="error"></h:messages>
           </a4j:outputPanel>
           <h:inputText value="#{bean.property}" required="true"></h:inputText>
           <a4j:commandLink value="click" oncomplete="windowclose();"
           reRender="test" />
           </h:form>
           </rich:modalPanel>
           <script type="text/javascript">
           //<![CDATA[
           function windowclose(){
           if (document.getElementById('mpform:error')==null){
           Richfaces.hideModalPanel('_panel');
           };
           };
          
           //]]>
           </script>
           <h:form>
           <h:commandButton action="inputname" value="main"></h:commandButton>
           </h:form>
           </ui:define>
          


          For example this code works fine for me.

          • 2. Re: modal panel problem -
            paulo5

            I got this problem if I had a clickable row in a rich:dataTable that fired an action listener to register the row clicked and then forwarded to another page to display the detail for that row.

            The reason was because I didn't have a tag in my navigation rule in Faces-config.xml

            Weirdly, it only produced the javascript error 'ModalPanel is undefined' in IE, not Firefox....

            Maybe this will help someone :-)

            • 3. Re: modal panel problem -
              paulo5

              Regarding the post above it should say 'redirect' tag

              (the chevrons were taken out)

              • 4. Re: modal panel problem -
                paulo5

                oh....and also it was an action controller not an action listener :-)

                I wish it would let me edit my posts :-)

                • 5. Re: modal panel problem -
                  ilya_shaikovsky

                  It would be better to paste simple code example of your use case.