views:

32

answers:

2

I know you can use a <rich:datascroller> when you want pagination on a <rich:dataTable>. But, what about a <rich:dataList> or <rich:dataOrderedList>? Is there any mechanism for pagination on these components? Or will I have to code in the logic by hand?

+3  A: 

Nowhere it is said that <rich:datascroller> works only with <rich:dataTable>. So I'd assume it works with most iteration tags - try it.

If it for some reason doesn't, you can easily emulate the appearance of a list using a table (with proper css)

Bozho
You're absolutely right. Even though the RichFaces docs imply that it can only be used with a data table, I found an example in the book "Practical RichFaces" that shows it being used with a data list. Thanks!!
Shadowman
+1  A: 

It would be very easy to build your own dataScroller. You can use the first and rows attributes on the <rich:dataList> component.

To accomplish this task all you have to do is write a bean that will handle the attribute values

<rich:dataList id="myList" first="#{dataScrollerBean.first}" rows="#{dataScrollerBean.rows}">
<a4j:commandButton action="#{dataScrollerBean.prev}" value="< Prev" reRender="myList"/>
<a4j:commandButton action="#{dataScrollerBean.next}" value="Next >" reRender="myList"/>
mmanco