6 Replies Latest reply on Oct 23, 2012 1:45 PM by jpadula35

    [PB3.1.0.Beta3] Uncaught ReferenceError: RichFaces is not defined

    jpadula35

      Ken,

      Using PortletBridge 3.1.0.Beta3

      RichFaces4.2.3.Final

      GateIn3.4.0_jbossAS6.Final

      JSF 2.1.13

      Spring 3.1.12

       

      Now that I can see errors in Developer Tools, I am getting closer to debugging an error that we've been having for over two years, going back to using GateIn3.1.0.GA with an older PortletBridge. But we are still seeing these problems even with an upgraded GateIn and PortletBridge and Richfaces, so there must be something wrong with what we are doing. Every now an then when we switch from one portlet to another the main table of the portlet page looses all of the grid. When it used to happen before we could refresh the page and it would come back to life. Now when it happens, I have to log out of Portal and then back in. In Chrome Developer Tools, Console tab, I am seeing these error messages, but can't make heads or tails out of them, any ideas on how to debug this?

       

      In this one case, first it says toolbarHandlers is not defined, then also RichFaces is not defined.

       

      </a></td><td class="rf-tb-emp"> </td></tr></table><script type="text/javascript">toolbarHandlers({"id":"pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:j_idt66","events":{} ,"groups":[] } );</script>

      Uncaught ReferenceError: toolbarHandlers is not defined

       

       

      <p></p>

       

      <div class="scroller"><table id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:elementTable" class="rf-dt"><colgroup span="6"></colgroup><thead id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:elementTable:th" class="rf-dt-thd"><tr id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:elementTable:ch" class="rf-dt-shdr"><th class="rf-dt-shdr-c" scope="col" id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:elementTable:j_idt85">Type</th><th class="rf-dt-shdr-c" scope="col" id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:elementTable:j_idt89">Class</th><th class="rf-dt-shdr-c" scope="col" id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:elementTable:j_idt92">Label</th><th class="rf-dt-shdr-c" scope="col" id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:elementTable:j_idt95"></th><th class="rf-dt-shdr-c" scope="col" id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:elementTable:j_idt98"></th><th class="rf-dt-shdr-c" scope="col" id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:elementTable:j_idt101"></th></tr></thead><tbody id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:elementTable:tb" class="rf-dt-b"><tr class="rf-dt-nd"><td colspan="6" class="rf-dt-nd-c" style="display: none;"></td></tr></tbody><tbody id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:elementTable:sc"><tr><td style="display: none"><script type="text/javascript">new RichFaces.ui.DataTable("pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:elementTable",{"ajaxEventOptions":{} } )</script></td></tr></tbody></table>

      Uncaught ReferenceError: RichFaces is not defined

       

      </div></div></div><span id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:sensorInterfaceEditorOkCancel" style="display:block; text-align:center"><input id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:j_idt104" name="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:j_idt104" onclick="RichFaces.ajax(&quot;pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:j_idt104&quot;,event,{&quot;incId&quot;:&quot;1&quot;} );return false;" value="OK" style="width:80px" type="submit" /><input id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:j_idt105" name="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:j_idt105" onclick="RichFaces.ajax(&quot;pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:j_idt105&quot;,event,{&quot;incId&quot;:&quot;1&quot;} );return false;" value="Cancel" style="width:80px" type="submit" /></span></div></div></div><script type="text/javascript">new RichFaces.ui.PopupPanel("pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:modalPanelPopupSensorInterfaceEditor",{"autosized":true,"domElementAttachment":"form"} );</script></div></div></div><div class="rf-p " id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:j_idt106" style="border-style:none;"><div class="rf-p-b " id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:j_idt106_body"><div id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:modalPanelPropertiesEdit" style="visibility: hidden;"><div class="rf-pp-shade" id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:modalPanelPropertiesEdit_shade" style="z-index:100;"><button class="rf-pp-btn" id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:modalPanelPropertiesEditFirstHref"></button></div><div class="rf-pp-cntr " id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:modalPanelPropertiesEdit_container" style="position: fixed; z-index:100; "><div class="rf-pp-shdw" id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:modalPanelPropertiesEdit_shadow"></div><div class="rf-pp-cnt-scrlr" id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:modalPanelPropertiesEdit_content_scroller"><div class="rf-pp-cnt" id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:modalPanelPropertiesEdit_content"><div class="rf-p " id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:propsPanel" style="border-style:none;"><div class="rf-p-b " id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:propsPanel_body"><div class="rf-p " id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:j_idt122" style="border-style:none;"><div class="rf-p-hdr " id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:j_idt122_header">User Defined Properties</div><div class="rf-p-b " id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:j_idt122_body">

      Uncaught ReferenceError: RichFaces is not defined

       

       

      <div class="scroller_small"><table id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:userPropertiesTable" class="rf-dt"><colgroup span="3"></colgroup><thead id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:userPropertiesTable:th" class="rf-dt-thd"><tr id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:userPropertiesTable:ch" class="rf-dt-shdr"><th class="rf-dt-shdr-c" scope="col" id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:userPropertiesTable:j_idt125"><span class="headerText">Key</span></th><th class="rf-dt-shdr-c" scope="col" id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:userPropertiesTable:j_idt128"><span class="headerText">Value</span></th><th class="rf-dt-shdr-c" scope="col" id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:userPropertiesTable:j_idt131"></th></tr></thead><tbody id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:userPropertiesTable:tb" class="rf-dt-b"><tr id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:userPropertiesTable:0" class="rf-dt-r rf-dt-fst-r"><td id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:userPropertiesTable:0:j_idt125" class="rf-dt-c colStyleRight"><input type="text" name="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:userPropertiesTable:0:j_idt127" value="" maxlength="128" style="width:95%" /></td><td id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:userPropertiesTable:0:j_idt128" class="rf-dt-c colStyleLeft"><input type="text" name="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:userPropertiesTable:0:j_idt130" value="" maxlength="256" style="width:95%" /></td><td id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:userPropertiesTable:0:j_idt131" class="rf-dt-c colStyleCentered"><a href="#" id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:userPropertiesTable:0:j_idt132" name="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:userPropertiesTable:0:j_idt132" onclick="RichFaces.ajax(&quot;pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:userPropertiesTable:0:j_idt132&quot;,event,{&quot;incId&quot;:&quot;1&quot;} );return false;"><img src="/stcs-portlet-sensor-interfaces/images/minus.png" alt="delete" title="delete" /></a></td></tr></tbody><tbody id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:userPropertiesTable:sc"><tr><td style="display: none"><script type="text/javascript">new RichFaces.ui.DataTable("pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:userPropertiesTable",{"ajaxEventOptions":{} } )</script></td></tr></tbody></table>

      Uncaught ReferenceError: RichFaces is not defined

       

      </div><a href="#" id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:j_idt135" name="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:j_idt135" onclick="RichFaces.ajax(&quot;pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:j_idt135&quot;,event,{&quot;incId&quot;:&quot;1&quot;} );return false;"><img src="/dev-portlet-sensor-interfaces/images/plus.png" />add new row</a></div></div></div></div><table id="pbGe8e0e590_2db335_2d4fb5_2d98fa_2df535b48c56e7_j_id1:j_idt5:prpOkCancel">

      <tbody

       

      Thanks for your help.

      Joe

        • 1. Re: [PB3.1.0.Beta3] Uncaught ReferenceError: RichFaces is not defined
          kenfinni

          Those not defined errors usually are because JS has not loaded properly, or because it loaded in an incorrect order.

           

          Have you enabled resource optimization for RF in web.xml?

          • 2. Re: [PB3.1.0.Beta3] Uncaught ReferenceError: RichFaces is not defined
            jpadula35

            I think it's enabled correctly.

             

            Here is how resource optimization is set in the web.xml:

             

                <context-param>

                    <param-name>org.richfaces.resourceOptimization.enabled</param-name>

                    <param-value>true</param-value>

                </context-param>

             

            Here is how the xhtml are:

            <!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:ui="http://java.sun.com/jsf/facelets"

                      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">

                      <h:head/>

                      <h:body>

                                <ui:composition>

                                          <ui:include src="main.xhtml">

                                                    <ui:param name="isEditor" value="true" />

                                          </ui:include>

                                </ui:composition>

                      </h:body>

            </html>

             

            main.xhtml:

            <ui:composition xmlns="http://www.w3.org/1999/xhtml"

                      xmlns:ui="http://java.sun.com/jsf/facelets"

                      xmlns:h="http://java.sun.com/jsf/html"

                      xmlns:f="http://java.sun.com/jsf/core"

                      xmlns:c="http://java.sun.com/jstl/core"

                      xmlns:a4j="http://richfaces.org/a4j"

                      xmlns:rich="http://richfaces.org/rich"

                      xmlns:fn="http://java.sun.com/jsp/jstl/functions"

                      xmlns:fnc="http://www.dev.com/dev/jsf/core">

             

             

                      <link href="/dev-portlet-resources/css/table.css" rel="stylesheet"

                                type="text/css" />

                      <link

                                href="#{facesContext.externalContext.requestContextPath}/css/sensorinterface.css"

                                rel="stylesheet" type="text/css" />

             

             

                      <f:loadBundle basename="common_messages" var="common_msgs" />

                      <f:loadBundle basename="sensorif_messages" var="msgs" />

             

             

                      <c:set var="mainRerenderComponent" value="mainPanel"></c:set>

             

             

                      <rich:panel style="border-style:none;">

             

            stuff...

             

            </rich:panel>

            </ui:composition>

             

            Can you confirm if we only put the <h:head/> tag on the outermost xhtml page?

             

            Thanks

            Joe

            • 3. Re: [PB3.1.0.Beta3] Uncaught ReferenceError: RichFaces is not defined
              kenfinni

              All that looks fine, and yes you only need h:head in the outermost xhtml page.

               

              Do the developer tools in the browser show all JS loaded when you get those errors?

              • 4. Re: [PB3.1.0.Beta3] Uncaught ReferenceError: RichFaces is not defined
                jpadula35

                I'm not entirely sure how to tell if all the JS is getting loaded. Here is the <h:head> at the time of the error. Does this look correct to you?

                 

                <!DOCTYPE html

                PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

                "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

                 

                 

                <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">

                <head id="head">

                <title>Sensor Interfaces Editor</title>

                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

                 

                 

                <link rel="shortcut icon" type="image/x-icon" href="/portal/favicon.ico" />

                 

                <link id="CoreSkin" rel="stylesheet" type="text/css" href="/eXoResources/skin/Stylesheet-lt.css" />

                 

                <link id="Defaultweb_BannerPortletDefaultweb_FooterPortletDefaultweb_NavigationPortlet" rel="stylesheet" type="text/css" href="/portal/resource/Default/web_BannerPortlet/Default/web_FooterPortlet/Default/web_NavigationPortlet/1350994126771-lt.css" />

                 

                 

                <script type="text/javascript">

                var require = {"shim":{"PORTLET/web/SiteMapPortlet":{"deps":["SHARED/bootstrap"]},"PORTLET/dashboard/TabbedDashboardPortlet":{"deps":["SHARED/bootstrap"]},"PORTLET/web/IFramePortlet":{"deps":["SHARED/bootstrap"]}},"paths":{"SHARED/navigation":"/portal/scripts/3.4.0.Final/SHARED/navigation-min","SHARED/dashboard":"/portal/scripts/3.4.0.Final/SHARED/dashboard-min","SHARED/webui":"/portal/scripts/3.4.0.Final/SHARED/webui-min","PORTLET/dashboard/TabbedDashboardPortlet":"/portal/scripts/3.4.0.Final/PORTLET/dashboard:TabbedDashboardPortlet-min","PORTLET/web/IFramePortlet":"/portal/scripts/3.4.0.Final/PORTLET/web:IFramePortlet-min","SHARED/gadget":"/portal/scripts/3.4.0.Final/SHARED/gadget-en-min","SHARED/common":"/portal/scripts/3.4.0.Final/SHARED/common-min","SHARED/webui-ext":"/portal/scripts/3.4.0.Final/SHARED/webui-ext-min","PORTLET/web/SiteMapPortlet":"/portal/scripts/3.4.0.Final/PORTLET/web:SiteMapPortlet-min","SHARED/bootstrap":"/portal/scripts/3.4.0.Final/SHARED/bootstrap-min","SHARED/base":"/portal/scripts/3.4.0.Final/SHARED/base-en-min","SHARED/portal":"/portal/scripts/3.4.0.Final/SHARED/portal-min","SHARED/jquery":"/portal/scripts/3.4.0.Final/SHARED/jquery-min"}};

                </script>

                 

                            <script type="text/javascript" src="/portal/scripts/3.4.0.Final/SHARED/bootstrap-min.js"></script>

                 

                <script type="text/javascript">

                eXo.env.addLoadedRemoteScripts([]);

                 

                eXo.env.portal.context = "/portal" ;

                eXo.env.portal.accessMode = "private" ;

                eXo.env.portal.portalName = "dev" ;

                eXo.env.server.context = "/portal" ;

                eXo.env.server.portalBaseURL = "/portal/dev/sensorif/sensorifEditor" ;

                eXo.env.server.portalURLTemplate = "/portal/dev/sensorif/sensorifEditor?portal:componentId={portal:componentId}&portal:action={portal:action}" ;

                eXo.env.client.skin = "Default" ;

                 

                eXo.portal.portalMode = 0;

                eXo.session.level = "onDemand";

                eXo.session.canKeepState = true;

                eXo.session.isOpen = false ;

                eXo.session.itvTime = 1800 ;

                </script>

                 

                </head>

                 

                I'm editing this, I just looked in Network tab, and looks like some stylesheets and js files did not get loaded (they are showing pending):

                 

                Stylesheet-lt.css

                /eXoResources/skin

                 

                GET

                200

                OK

                 

                text/css

                sensorifEditor:14

                Parser

                 

                (from cache)

                Pending

                 

                0

                 

                0

                1350994126771-lt.css

                /portal/resource/Default/web_BannerPortlet/Default/web_FooterPortlet/Default/web_NavigationPortlet

                 

                GET

                200

                OK

                 

                text/css

                sensorifEditor:16

                Parser

                 

                (from cache)

                Pending

                 

                table.css

                /dev-portlet-resources/css

                 

                GET

                200

                OK

                 

                text/css

                sensorifEditor:23

                Parser

                 

                (from cache)

                Pending

                 

                base-en-min.js

                /portal/scripts/3.4.0.Final/SHARED

                 

                GET

                200

                OK

                 

                text/javascript

                bootstrap-min.js:34

                Script

                 

                (from cache)

                Pending

                 

                jquery-min.js

                /portal/scripts/3.4.0.Final/SHARED

                 

                GET

                200

                OK

                 

                text/javascript

                bootstrap-min.js:34

                Script

                 

                (from cache)

                Pending

                 

                Message was edited by: Joseph Padula - edited to add pending section on bottom.

                • 5. Re: [PB3.1.0.Beta3] Uncaught ReferenceError: RichFaces is not defined
                  kenfinni

                  That doesn't look like any of the RF JS has been loaded.

                   

                  Is there anything in the server.log?

                  • 6. Re: [PB3.1.0.Beta3] Uncaught ReferenceError: RichFaces is not defined
                    jpadula35

                    No, that's the strange thing, not one line was added to the server.log (by the way, I edited my previous reply with some more info from the Network tab, but looks like you already figured that out.)