我有以下确定年代:RichFaces的数据表和子表
<rich:dataTable id="grid1" value="#{monitorForm.customerList}" var="custRow">
<rich:column width="5">
<h:selectBooleanCheckbox value="#{custRow.selected}">
<a:support event="onclick" action="#{monitorForm.selectOrderLines(custRow)}"
reRender="custTable_#{custRow.id}"/>
</h:selectBooleanCheckbox>
</rich:column>
<rich:subTable id="custTable_#{custRow.id}"
var="row" value="#{custRow.orderList}" rendered="#{custRow.show}">
<rich:column width="5">
<h:selectBooleanCheckbox value="#{row.checked}" />
</rich:column>
<rich:column>
<h:outputText value="#{row.name}" />
</rich:column>
</rich:subTable>
</rich:dataTable>
当我点击复选框动作#{monitorForm.selectOrderLines(custRow)}
设置所选客户的复选框,我只想要子表为客户进行重新描绘。 以上不起作用。
错误是[AjaxContext] Target component for id custTable_<id number>
不存在。
当我使用reRender="grid1"
时,一切正常,但有很多行时可能会非常缓慢。
是否有可能让rich:subTable
带有一个动态ID,我可以用它来重新生成只有该子表?
嗨,可以有很多subTables取决于客户数量,所以1个ID都不起作用。另外我读了这个ID不能动态设置。有关于此的一个很好的答案在http://stackoverflow.com/questions/316790/dynamic-ids-in-jsf-seam – Guus 2010-11-08 13:07:13