带有id(“myButtonId2”)的Commandbutton可以正常工作。我的意思是它更新“myOutputPanel”,但是在datatable中的commandbutton不会更新outputPanel。 datatables有特定的更新风格吗?如何从数据表中更新面板
<h:form id="myForm" prependId="false">
<p:panel id="myPanel">
<p:dataTable id="myDatatable">
<p:column style="width:4%">
<p:commandButton id="myButtonId" update="myOutputPanel"/>
</p:column>
</p:dataTable>
<p:commandButton id="myButtonId2" update="myOutputPanel"/>
</p:panel>
<p:outputPanel id="myOutputPanel">
//some stuff
</p:outputPanel>
我收到此错误。 “无法找到标识符为”myView:myDatatable:0:myButtonId“”的myForm:myOutputPanel“引用。顺便说一下,这个页面是在一个标签内,而tabview的ID是“tabView”。 – 2013-05-03 12:28:49
我也试过“tabView:myOutputPanel”和“:tabView:myOutputPanel”和“:myOutputPanel”。他们都没有工作。 – 2013-05-03 12:35:12
@TurgutDsfadfa TabView的也是NamingContainer但它是建立在一个'UI:repeat'所以您不能直接访问的绝对clientID的这一点。你要么需要更新整个TabView的,或者你可以使用'@ form'保留值更新'myForm'内的所有元素。 – 2013-05-03 12:39:23