3 Replies Latest reply on Aug 7, 2009 4:35 PM by Alexander Smirnov

    Javascript error in ui.pack.js

    hello All Newbie

      Hi,

      I am using richfaces tree and encounter the below javascript error when a tree node is clicked in Internet Explorer. This error does not occur in Firefox. The below error is from ui.pack.js

      while(D&&Element.isChildOf(D,this.element)){C+=D.offsetTop;
      D=D.offsetParent
      }D=F;


      I tried using Richfaces version 3.3.1 (latest) and 3.2.1 but encounter the error in both versions.

      Has anyone faced this error? Any suggestions/comments appreciated.

      Thanks.


        • 1. Re: Javascript error in ui.pack.js
          Nick Belaevski Master

          Hi,

          Please post page code.

          • 2. Re: Javascript error in ui.pack.js
            hello All Newbie

            Hello,
            Here is the code snippet:

            <a4j:outputPanel id="myReportsTreePanel" >
             <rich:tree style="width:230px" switchType="client"
             value="#{reportCenterMgr.myReportsTreeNode}" id="myReportsNamesTree"
             var="item" iconExpanded="/images/origImage.gif" iconCollapsed="/images/origImage2.gif"
             bypassUpdates="true" nodeFace="#{item.type}" rendered="#{!reportCenterMgr.projectUnavailable}">
             <rich:treeNode type="#{item.type}" icon="/images/#{item.icon}" iconLeaf="/images/#{item.icon}" highlightedClass="tree-node-selected" selectedClass="tree-node-selected">
             <h:outputText value="#{item.name}" rendered="#{item.type == 8}" style="color: white;">
             </h:outputText>
            
             <a4j:commandLink value="#{item.name}" rendered="#{item.type == 3 or item.type == 55 }" onclick="reportName='#{item.name}';document.getElementById('iFrame').src='#{reportCenterMgr.reportSubmittedPage}' + '?reportName=' + reportName"
             actionListener="#{reportCenterMgr.objectNameClicked}"
             event="onclick" reRender="iFramePanel,titlePanel,myUserInputsPanel, sharedUserInputsPanel, defaultProjectPanel">
             <f:param name="objectName" value="#{item.name}" />
             <f:param name="objectId" value="#{item.id}" />
             <f:param name="objectType" value="#{item.type}" />
             </a4j:commandLink>
             <ui:include src="objectContextMenu.xhtml">
             <ui:param name="treeName" value="my"/>
             </ui:include>
             </rich:treeNode>
             </rich:tree>
             <h:outputText rendered="#{reportCenterMgr.isMyReportsEmpty}" value="#{msgs.empty_folder}" style="color: white;"> </h:outputText>
             </a4j:outputPanel>

            objectContextMenu.xhtml
            <f:view contentType="text/html"
             xmlns:ui="http://java.sun.com/jsf/facelets"
             xmlns:f="http://java.sun.com/jsf/core"
             xmlns:h="http://java.sun.com/jsf/html"
             xmlns:c="http://java.sun.com/jstl/core"
             xmlns:a4j="http://richfaces.org/a4j"
             xmlns:rich="http://richfaces.org/rich">
            <rich:contextMenu event="oncontextmenu" attached="true"
             submitMode="ajax">
             <rich:menuItem icon="/images/Search.gif" rendered="#{item.type == 3 or item.type == 55 }" value="#{msgs.view_object}" limitToList="true" labelClass="context-menu-item-label" ajaxSingle="true" onclick="reportName='#{item.name}';document.getElementById('iFrame').src='#{reportCenterMgr.reportSubmittedPage}' + '?reportName=' + reportName"
             actionListener="#{reportCenterMgr.contextMenuClicked}" reRender="titlePanel,iFramePanel,myUserInputsPanel, sharedUserInputsPanel, defaultProjectPanel">
             <ui:include src="params.xhtml">
             <ui:param name="menuItem" value="view"/>
             </ui:include>
             </rich:menuItem>
             <rich:menuItem icon="/images/Remove_2.gif" value="#{msgs.delete_object}" limitToList="true" labelClass="context-menu-item-label" ajaxSingle="true"
             actionListener="#{reportCenterMgr.contextMenuClicked}" reRender="myUserInputsPanel, sharedUserInputsPanel, defaultProjectPanel">
             <ui:include src="params.xhtml">
             <ui:param name="menuItem" value="delete"/>
             </ui:include>
             </rich:menuItem>
            
             <rich:menuItem icon="/images/Edit.gif" rendered="#{item.type == 3 or item.type == 55 }" value="#{msgs.edit_object}" limitToList="true" labelClass="context-menu-item-label" ajaxSingle="true"
             actionListener="#{reportCenterMgr.contextMenuClicked}" reRender="titlePanel,iFramePanel,myUserInputsPanel, sharedUserInputsPanel, defaultProjectPanel">
             <ui:include src="params.xhtml">
             <ui:param name="menuItem" value="edit"/>
             </ui:include>
             </rich:menuItem>
            
             <rich:menuItem icon="/images/Save_As.gif" value="#{msgs.rename_object}" limitToList="true" labelClass="context-menu-item-label" ajaxSingle="true"
             actionListener="#{reportCenterMgr.contextMenuClicked}" reRender="myUserInputsPanel, sharedUserInputsPanel, defaultProjectPanel">
             <ui:include src="params.xhtml">
             <ui:param name="menuItem" value="rename"/>
             </ui:include>
             </rich:menuItem>
            
             <rich:menuItem icon="/images/iconFolder.gif"
             labelClass="context-menu-item-label" ajaxSingle="true"
             actionListener="#{reportCenterMgr.labelContextMenuItemClicked}"
             reRender="myUserInputsPanel, sharedUserInputsPanel, defaultProjectPanel"
             rendered="#{item.name eq 'Published Reports' and treeName eq 'shared'}">
             <b> #{msgs.create_folder}</b>
             <ui:include src="params.xhtml">
             <ui:param name="menuItem" value="createFolder"/>
             </ui:include>
             </rich:menuItem>
            
             <rich:menuSeparator rendered="#{item.type == 3 or item.type == 55 }"/>
             <rich:menuItem icon="/images/Check.gif" rendered="#{item.type == 3 or item.type == 55 }" value="#{msgs.set_default_report}" limitToList="true" labelClass="context-menu-item-label" ajaxSingle="true"
             actionListener="#{reportCenterMgr.contextMenuClicked}" reRender="myUserInputsPanel, sharedUserInputsPanel,defaultProjectPanel">
             <ui:include src="params.xhtml">
             <ui:param name="menuItem" value="setAsDefault"/>
             </ui:include>
             </rich:menuItem>
            
            
            
             </rich:contextMenu>
             </f:view>
            


            • 3. Re: Javascript error in ui.pack.js
              Alexander Smirnov Master

              Do you use any additional JavaScript libraries on page ? RichFaces script contains prototype/jQuery libraries that could provide errors if different version of same libraries have been loaded together.