primefaces板从另一种形式的AJAX更新 [英] primefaces ajax update of panel from another form
问题描述
我有一些code在这里:
I have some code here:
<f:view>
<h:form id="formA">
<p:treeTable id="tree">
<p:ajax event="select" listener="..." update="mustRefresh" />
...
</p:treeTable>
</h:form>
<h:form id="formB">
<p:panel id="mustRefresh"> ... </p:panel>
</h:form>
</f:view>
当用户选择的treetable中(FORMA)的记录,其细节将显示在formB并准备编辑。我的问题是更新=mustRefresh不行,抛出异常是这样的:
When user select a record on treeTable(formA), its detail will show on formB and ready to edit. My trouble is update="mustRefresh" not work, it throw exception like this:
javax.faces.FacesException: Cannot find component with identifier "mustRefresh" referenced from "A4578:formA:tree".
我试着用@form,formB,:formB和:mustRefresh,但它不能正常工作
I tried with @form, formB, :formB and :mustRefresh but it does not work.
推荐答案
由于 mustRefresh
在组件层次结构里面 formB
要参考它:
Since mustRefresh
in the component hierarchy is inside formB
you should reference it with:
<p:ajax event="select" listener="..." update=":formB:mustRefresh" />
请参阅如何<一个href="http://docs.oracle.com/javaee/6/api/javax/faces/component/UIComponentBase.html#findComponent%28java.lang.String%29">UIComponentBase.findComponent工作原理。
这篇关于primefaces板从另一种形式的AJAX更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!