问题描述
我已将代码最小化,以更好地向您展示什么不起作用.
I have minimized my code to better show you what is not working.
<h:body>
<f:view>
<h:form id="wbSelectForm">
<p:commandButton id="viewWorkbenchButton" icon="ui-icon-show"
title="View Workbench" update=":wbTestPanel"
actionListener="#{WorkbenchControllerBean.test}">
</p:commandButton>
</h:form>
<p:panel id="wbTestPanel">
Test: Active Wb: #{WorkbenchControllerBean.number}
</p:panel>
</f:view>
</h:body>
当我按下commandButton时,我希望'wbTestPanel'正在更新,但不会发生.我知道这是因为未调用WorkbenchControllerBean.getNumber().
When i press the commandButton, i would expect that 'wbTestPanel' is being updated, which does somehow NOT happen. I know that because WorkbenchControllerBean.getNumber() is not called.
我正在使用primefaces 3.5.我已经尝试过为'process'-attribute分配differend值,并将RequestContext.getCurrentInstance().update("wbTestPanel")
放入WorkbenchControllerBean.test()-method.
I am using primefaces 3.5. I already tried differend values for 'process'-attribute as well as putting RequestContext.getCurrentInstance().update("wbTestPanel")
in WorkbenchControllerBean.test()-method.
我认为代码也许是正确的,但是项目或运行时环境(Java 7 + JBoss 7.1.1)中的任何设置都阻止了primeface更新其他面板.您能给我一个提示,搜索什么吗?
I think that maybe the code is right, but there are any settings in the project or runtime environment (Java 7 + JBoss 7.1.1) that prevent primefaces from updating the other panel. Could you please give me a hint what to search for?
提前谢谢!
推荐答案
您确定调用了test()方法吗?如果是,您可以尝试使用以下更新表达式吗?
Are you sure that test() method is invoked?If yes, can you try with following update expression?
update="@([id$=wbTestPanel])"
否则,可能由于验证错误而未调用test()方法的情况.如果是这样,您可以使用debug或firebug对其进行检查.
Otherwise, it maybe the case that test() method is not called because of a validation error. If that is the case, you can inspect it with debug or firebug.
这篇关于primefaces命令按钮更新不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!