[英]Error with p:selectOneMenu in Primefaces 3.4.2
I recently updated Primefaces from 3.4 to 3.4.2 and now I have problems on some pages where there is p:selectOneMenu
component. 我最近更新了Primefaces从3.4到3.4.2,现在我在一些有
p:selectOneMenu
组件的页面上遇到了问题。 I see error in JavaScript console which says: TypeError: e.offset(...) is undefined
. 我在JavaScript控制台中看到错误说:
TypeError: e.offset(...) is undefined
。 This error is logged immediately on page loading. 页面加载时会立即记录此错误。
Does anyone know what is a problem? 有谁知道什么是问题?
OK, after a lot of time a finally figure out what's happening. 好吧,经过很长一段时间后,终于弄明白发生了什么。 In Primefaces 3.4.2 behavior of
p:selectOneMenu
is changed little bit, in that way that change event is fired immediately after page is loaded. 在Primefaces 3.4.2中
p:selectOneMenu
行为稍有改变,这样在加载页面后立即触发change事件。 This problem is manifesting when we have completely empty p:selectOneMenu
, which means value
of f:selectItems
is null, and there is no f:selectItem
for empty option. 当我们完全是空的这个问题表现
p:selectOneMenu
,这意味着value
的f:selectItems
是空的,没有f:selectItem
为空的选项。 In that case we can see error TypeError: e.offset(...) is undefined
in console and javascript is from that point useless, and nothing works any more. 在这种情况下,我们可以看到错误
TypeError: e.offset(...) is undefined
在控制台中TypeError: e.offset(...) is undefined
,而javascript从那一点是无用的,并且没有任何工作。 For now it has to be empty f:selectItem
, or at least one element in f:selectItems
. 现在它必须是空的
f:selectItem
,或在至少一个元件f:selectItems
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.