Richfaces collapsiblePanel randomly causes javascript error in Chrome

匆匆过客 提交于 2019-12-04 14:48:08

问题


I'm working on a complex web application with RichFaces 4.5.13.Final and JSF 2.1 on JBoss EAP 6.4. Some pages containing a collapsiblePanel like this

            <h:form id="myForm">
             <rich:collapsiblePanel id="myPanel" header="Header" switchType="client">
              <h:outputText value="Test" />
             </rich:collapsiblePanel>
            </h:form>

In Google Chrome (tested with Version 57.0.2987.110 (64-bit)) we've noticed a strange javascript error after page load. This error occurs randomly but not always:

Uncaught TypeError: Cannot read property 'getItems' of undefined
at init (togglePanelItem.js:43)
at new init (collapsiblePanelItem.js:32)
at HTMLDocument.<anonymous> (collapsiblePanel.js:52)
at fire (jquery.js?amp;v=4.5.13.Final:3232)
at Object.fireWith [as resolveWith] (jquery.js?amp;v=4.5.13.Final:3362)
at Function.ready (jquery.js?amp;v=4.5.13.Final:3582)
at HTMLDocument.completed (jquery.js?amp;v=4.5.13.Final:3617)

For example, if I'm reloading the page 10 times this error will occurs around 5 times. In other browsers like Firefox this error never occurs.

It looks like that the javascript files are randomly loadad. So I'm already tried to use compressed files for RichFaces by setting the org.richfaces.resourceOptimization.enabled to true but the error still occurs.

I would like to solve this issue, but I have no idea how can I localise this issue.

EDIT

After debugging a while, I found out that there are some parallels to https://issues.jboss.org/browse/RF-13780 because sometimes element[rf.RICH_CONTAINER] is undefined in rf.component for some reasons.

来源:https://stackoverflow.com/questions/42926712/richfaces-collapsiblepanel-randomly-causes-javascript-error-in-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!