是否可以在subTable
組件或列中使用forEach
循環,在Richfaces 3.3?我需要渲染動態數量的列,但沒有成功。For-each loop in rich:子表
例子:
<rich:dataTable
cellpadding="0" cellspacing="0"
width="700" border="1" var="serviceCharge"
value="#{group.serviceCharges}">
<rich:column colspan="3">
<h:outputText value="#{group.name},#{serviceCharge.code}" />
</rich:column>
<rich:subTable var="priceType" value="#{serviceCharge.priceTypes}">
<rich:column colspan="#{group.priceLevels.size}">
<b><h:outputText value="#{priceType.name}" /></b>
</rich:column>
<rich:subTable var="priceLevelItem" value="#{priceType.priceLevels}">
<rich:column colspan="3">
<h:outputText value="Qty" />
</rich:column>
<c:forEach items="#{priceType.priceLevels}" var="priceLevelItem">
<rich:column colspan="3">
<h:outputText value="#{priceLevelItem.id},#{priceLevelItem.qty}" />
</rich:column>
</c:forEach>
</rich:subTable>
<rich:subTable var="priceLevelItem" value="#{priceType.priceLevels}">
<rich:column colspan="3">
<h:outputText value="Amount" />
</rich:column>
<rich:column colspan="3">
<h:outputText value="#{priceLevelItem.id},#{priceLevelItem.amount}" />
</rich:column>
</rich:subTable>
</rich:subTable>
</rich:dataTable>
感謝