4 Replies Latest reply on May 14, 2011 9:04 PM by teme_h

    Richfaces is not defined (firefox)/ 'Richfaces' is undefined (IE)

    teme_h

      Hello, I am upgrading our application to Jboss 6 Final (JSF 2.0.3-b5) and Richfaces 4.0 Final. I am running into issues with exising code that calls richfaces javascript from a4j:command oncomplete event. I do define h:head and I see that javascript files are being included but I still run into Richface is undefined javascript error.

       

      Here is a simlified version that would give the above error in both IE and Firefox when debugged. Am missing something...

       

       

      <?xml version='1.0' encoding='UTF-8' ?>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:a4j="http://richfaces.org/a4j"
          xmlns:rich="http://richfaces.org/rich">
      <h:head>
      </h:head>
      <h:body>
          <h:form>
              <a4j:commandButton value="OK" 
                  oncomplete="Richfaces.showModalPanel('popUpPnl')" />
          </h:form>
      
         <rich:popupPanel modal="true" id="popUpPnl">
          ....
         </rich:popupPanel>
      </h:body>
       </html>
      
      

       

       

      Thanks,

      - Teme

        • 1. Richfaces is not defined (firefox)/ 'Richfaces' is undefined (IE)
          mp911de

          Hi Teme,

          wrap your view into f:view (html/f:view/h:head...../h:body/f:view/html).

          Best regards,

          Mark

          • 2. Re: Richfaces is not defined (firefox)/ 'Richfaces' is undefined (IE)
            teme_h

            Mark, Thanks for the response... but I still get the same error after using the format you suggested. Code below:

             

             

            <?xml version='1.0' encoding='UTF-8' ?>
            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
            <html xmlns="http://www.w3.org/1999/xhtml"
             xmlns:h="http://java.sun.com/jsf/html"
             xmlns:f="http://java.sun.com/jsf/core"
             xmlns:a4j="http://richfaces.org/a4j"
             xmlns:rich="http://richfaces.org/rich">
            <f:view>
             <h:head>
             </h:head>
             <h:body>
              <h:form>
               <a4j:commandButton value="OK"
                oncomplete="Richfaces.showModalPanel('popUpPnl', {top:'100px', left:'250px'})" />
              </h:form>
              
              <rich:popupPanel modal="true" id="popUpPnl">
                  ....
                 </rich:popupPanel
             </h:body>
            </f:view>
            </html>
            


            Thanks,

            Teme

            • 3. Richfaces is not defined (firefox)/ 'Richfaces' is undefined (IE)
              mp911de

              Hi Teme,

              i saw now that you use RF4. In this case you can use two ways:

               

              1. Either oncomplete="#{rich:component('popUpPnl')}.show('', {top:'100px', left:'250px'});"
              2. or: oncomplete="RichFaces.ui.PopupPanel.showPopupPanel('myForm:popUpPnl', {top:'100px', left:'250px'});" (NOTE: in this example the full Component Id is needed, so you would have to assign to your Form a defined Id

               

              Best regards,

              Mark

              • 4. Re: Richfaces is not defined (firefox)/ 'Richfaces' is undefined (IE)
                teme_h

                Thanks Mark! That worked.