[英]Using binding attribute causes javax.faces.FacesException: Cannot find component with identifier
I have a problem I can't quite get a handle on. 我有一个我无法完全解决的问题。
First the context: I am developing a web application using Primefaces 3.5 (yes, unfortunately I am stuck with this old version for now), running on JBoss 7. 首先是上下文:我正在使用在JBoss 7上运行的Primefaces 3.5开发Web应用程序(是的,不幸的是,我暂时仍然使用旧版本)。
There is a form with id "form" encompassing all following xhtml code. 有一个包含所有以下xhtml代码的ID为“ form”的表单。
I have a component in my view which is provided by usage of the binding attribute: 我的视图中有一个通过使用binding属性提供的组件:
<p:dashboard id="dashboard" binding="#{myBackingBean.dashboard}" />
Then sometimes I would like to perform an ajax update on this component, this is done by using the RemoteCommand component of primefaces: 然后有时我想对该组件执行ajax更新,这是通过使用primefaces的RemoteCommand组件完成的:
<p:remoteCommand
actionListener="#{myBackingBean.someActionListener()}"
process="@this" id="myRmtCmd" oncomplete="myJsFunction();"
update=":form:dashboard" name="myRemoteCommand" />
The RemoteCommand is triggered by a clicking on a Link: 单击链接可触发RemoteCommand:
<a href="#!" onclick="myRemoteCommand();">Some Text</a>
This works pretty well so far. 到目前为止,效果很好。 However after deploying this code to production I sometimes get a FacesException: 但是,在将此代码部署到生产环境后,有时会遇到FacesException:
javax.faces.FacesException: Cannot find component with identifier ":form:dashboard"
referenced from "form:myRmtCmd".
This is where my problem lies because I cannot reliably reproduce this exception. 这是我的问题所在,因为我无法可靠地重现此异常。 My question is this: What could lead to this exception being thrown? 我的问题是:什么可能导致引发此异常? It seems to work 95 % of the time but being the perfectionist I am (and many of you reading this are as well, I'm sure ;) ) I would like this code to work 100 % of the time. 它似乎在95%的时间内都能正常工作,但作为我的完美主义者(我敢肯定,许多阅读本书的人也是如此;))我希望这段代码在100%的时间内都能正常工作。 What am I missing? 我想念什么?
Before answering please consider these constraints: 在回答之前,请考虑以下约束:
Cheers, ps 欢呼声,ps
I also had this weird behavior. 我也有这种奇怪的行为。
There are probably more than one component bindded to #{myBackingBean.dashboard}
, so the first one sets the id and there will be no one called " dashboard ". 绑定到#{myBackingBean.dashboard}
组件可能不止一个,因此第一个组件设置ID,并且将没有一个称为“ 仪表板 ”的组件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.