6 Replies Latest reply on Dec 12, 2007 12:33 PM by marinew

    Richfaces.showModalPanel not a function

    kgoedert

      Hello,

      I have a page with an modal dialog like this:

      <rich:modalPanel id="panel">
      <f:facet name="header">
      <h:outputText value="header"/>
      </f:facet>
      <h:messages/>
      <a href="javascript:RichFaces.hideModalPanel('form:panel')">Hide
      </rich:modalPanel>

      I wanted that as a result of a command button action on a oncomplete event in a external js file I would have a js function that would show this dialog. I did this on my js file:

      function loginBack(){
      Richfaces.showModalPanel('form:panel',{width:450, top:200});
      }

      This js is imported on the page. When I click the button the loginBack() function is called but I get Richfaces.showModalPanel not a function

      What am I doing wrong? Do I have to import any js files in my file that has loginBack function?

      Thanks

      Kelly

        • 1. Re: Richfaces.showModalPanel not a function
          nbelaevski

          Kelly,

          there were some issues causing "Richfaces not defined" or Richfaces attributes disappearing in RC3: http://jira.jboss.com/jira/browse/RF-670 ? What RF version are you using? If that is RC3 version than could you please try upgrading to RC4?

          • 2. Re: Richfaces.showModalPanel not a function
            marinew

            Hello,

            I am trying to use ModalPanel, and I have the same Javascript error as Kelly :
            RichFaces.showModalPanel is not a function

            Here is the code :

            <rich:modalPanel id="ChoixCorrespondantModalPanel" minHeight="200" minWidth="450"
             height="200" width="500" zindex="2000" left="10" top="10">
             <f:facet name="header">
             <h:outputText value="TITRE" />
             </f:facet>
            
             </f:facet>
             <h:outputText value="TEST !" />
             <h:outputText value="Fermer cette fenetre" onclick="javascript:Richfaces.hideModalPanel('body:ChoixCorrespondantModalPanel')"/>
            </rich:modalPanel>


            and :

            <t:commandButton id="ChoisirMedecinTraitant"
             value="#{msgP.DossierPatient_ChoisirMedecinTraitant}"
             onclick="javascript:RichFaces.showModalPanel('body:ChoixCorrespondantModalPanel');"/>



            I am using RichFaces 3.1.0 with MyFaces 1.1.5 + Tomahawk 1.1.6.

            Why may this error occur ?

            marc@jboss say at http://jboss.com/index.html?module=bb&op=viewtopic&t=119945 :

            IMHO the richfaces modalpanel implementation is still very unstable and not ready yet for production use. so, if you dont really need it, avoid modal panels at all (of course we need them in my project, and therefore are forced to use them ;-) ..)


            Is ModalPanem really unstable in 3.1.0 version ? I don't see anything like this in developer documentation...

            Thanks for help

            • 3. Re: Richfaces.showModalPanel not a function
              marinew

              I just found the mistake...
              There is no upper case "F" in "Richfaces.showModalPanel !!

              However, I am still interested for answer to the question in my precedent post :
              Is ModalPanel unstable in 3.1.0 version ?

              • 4. Re: Richfaces.showModalPanel not a function

                unstable like what?

                • 5. Re: Richfaces.showModalPanel not a function
                  ilya_shaikovsky

                  Modal Panel has numerous bugfixes and tasks complete from 3.0.0 and even 3.0.1. Most of them fixed based on customers requests. So from this point of view you can be sure - that the best version is latest GA version. :)

                  • 6. Re: Richfaces.showModalPanel not a function
                    marinew

                    Hello,

                    Thanks for your posts, and sorry for answering only now !
                    I just realized that I don't receive mail when someone answer to my posts !

                    unstable like what?

                    heu... I don't know ! I only refered to what I read in the link I told you about.

                    However, my ModalPanel seems to work perfectly, so it's ok for me !