>不起作用
我的 jsf 2.1 页面上有以下 primefaces 按钮:
<p:commandButton value="#{msg['button.halt']}" action="#{viewBean.haltTask}" ajax="false">
<f:setPropertyActionListener target="#{myBean.disabled}" value="false" />
</p:commandButton>
在应用程序的另一点上,我使用 读取值
...
<f:validateBean disabled="#{myBean.disabled}" />
...
现在重点是读取按预期工作,意味着在 myBean 上调用 isDisabled() 方法。 用setPropertyActionListner写法不行。 setter 永远不会被调用。 myBean 的范围为“请求”。 一切都在带有 EL 2.2.x 的 Tomcat 7 上的 Servlet 3 容器中运行。
有人提示可能是什么错误吗?
最好的问候,
弗洛里安
I have the following primefaces button on my jsf 2.1 page:
<p:commandButton value="#{msg['button.halt']}" action="#{viewBean.haltTask}" ajax="false">
<f:setPropertyActionListener target="#{myBean.disabled}" value="false" />
</p:commandButton>
At another point in the application I read the value with
...
<f:validateBean disabled="#{myBean.disabled}" />
...
Now the point is the reading works as expected, means the isDisabled() method is called on the myBean.
The writing with the setPropertyActionListner does not work. The setter is never called.
The myBean has Scope "request".
Everything runs in a Servlet 3 container on Tomcat 7 with EL 2.2.x.
Does anybody have a hint what the error might be?
Best regards,
Florian
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试将 myBean 的范围更改为 viewscope,
另请查看此线程中的 BalusC 答案 f:setPropertyActionListener 设置空值而不是预期值
try to change the scope of the myBean to viewscope,
also take a look at BalusC answer in this thread f:setPropertyActionListener sets null value instead of intended value