I've use the datatable target and commandlink to impl a page table.
But the method showPrevious and showNext will run more than one times?I cann't
find the problem.
I've used MyFaces core1.1.
CODE:
<h:dataTable id="userTable2" rows="5" value="#{tableBean.users}" var="user">
<f:facet name="spacer">
<f:verbatim>&#160;</f:verbatim>
</f:facet>
<h:column>
<f:facet name="header">
<h:outputText value="First Name"/>
</f:facet>
<h:outputText value="#{user.firstName}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Last Name"/>
</f:facet>
<h:outputText value="#{user.lastName}"/>
</h:column>
<f:facet name="footer">
<h:panelGroup>
<h:commandLink actionListener="#{tableBean.previous}"
rendered="#{tableBean.showPrevious}"
style="padding-right:5px">
<h:outputText value="<<Previous"/>
</h:commandLink>
<h:commandLink actionListener="#{tableBean.next}"
rendered="#{tableBean.showNext}">
<h:outputText value="Next>>"/>
</h:commandLink>
</h:panelGroup>
</f:facet>
</h:dataTable>