gpt4 book ai didi

javascript - RichFaces 应用程序在 Chrome 57+ 上出现 JS 错误 "Cannot read property ' switchToItem' of undefined”

转载 作者:行者123 更新时间:2023-11-29 21:07:56 26 4
gpt4 key购买 nike

我有一个带有选项卡的 jsp 页面。有时会发生错误(当我按下标签时)“无法读取未定义的属性‘switchToItem’” undefined error

Uncaught TypeError: Cannot read property 'switchToItem' of undefined 
at init.__onHeaderClick (packed.js:6102)
at HTMLTableCellElement.<anonymous> (packed.js:1333)
at HTMLTableCellElement.dispatch (jquery.js:846)
at HTMLTableCellElement.eventHandle (jquery.js:722)

据我了解,错误发生在 packed.js 中(这是一个 js 文件,由版本 4.3.4 的 richfaces 打包)。我查看了这个文件,发现 RichFaces 试图找到一个选项卡列表。这些选项卡位于属性“rf”(element[richfaces.RICH_CONTAINER])中,但在我按下选项卡的那一刻,没有属性。

此错误在 chrome v.57 中重现,在版本 56 中不会重现。你能帮我一些建议吗,如何解决?

一些技术细节:

  • 我使用 xmlns:rich="http://richfaces.org/rich" <rich:tabPanel>在我的 jsp 页面中标记
  • 在 pom.xml 中 <richfaces.version>4.3.4.Final</richfaces.version>

最佳答案

James G,你的 richfaces.js 有误

   richfaces.$$ = function(componentName, element) {
while (element.parentNode) {
var containerId = element.getAttribute(richfaces.RICH_CONTAINER);
if (containerId && containerId !== "" && !!richfaces.COMPONENT_MAP[containerId] && richfaces.COMPONENT_MAP[containerId].component.name == componentName) {
return e.component;
}
else {
element = element.parentNode;
}
}
};

没有e。您需要将其更改为

...
return richfaces.COMPONENT_MAP[containerId].component;
...

关于javascript - RichFaces 应用程序在 Chrome 57+ 上出现 JS 错误 "Cannot read property ' switchToItem' of undefined”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43072230/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com