红色字体部分即时关键部分:
richfaces:
<rich:dataTable id="fmTable" columns="5" var="record"
rowKeyVar="rowIndex"
styleClass="datalist_table"
value="#{activityInfoList}">
<rich:column width="80">
<f:facet name="header">
<h:outputText value="序号" />
</f:facet>
<h:outputText value="#{rowIndex+1}"></h:outputText>
</rich:column>
</rich:dataTable>
tomahawk:
<t:dataTable var="record" rowIndexVar="rowIndex"
value="#{activityInfoList}>
<t:column>
<f:facet name="header">
<h:outputText value="序号" />
</f:facet>
<h:outputText value="#{rowIndex+1}"></h:outputText>
</t:column>
</t:dataTable>
如果分页查询,想要使序号显得更合理,则需要根据当前页号和每页显示的记录数计算,很容易计算出正确序号
本文介绍了使用RichFaces和Tomahawk组件库在富客户端应用中实现带有序号的动态表格的方法。针对分页场景,文章还探讨了如何计算合理的序号以提升用户体验。
5473

被折叠的 条评论
为什么被折叠?



