>From my limited use of DataScroller, it's simply a decorator.
You design as if it doesn't exist (ie, work everything through your DataTable).
Then you stick a couple DataScroller components on your page to modify
what's actually rendered and displayed, and add a "rows" parameter to
dataTable.
Here are the two datascrollers I'm using (modified from the
datascroller example program in myfaces. There's nothing to it other
than this code -- no backing bean support, configuration files, or
java code behind it.
<x:dataScroller id="scroller_controls"
for="datatable"
fastStep="10"
pageCountVar="pageCount"
pageIndexVar="pageIndex"
styleClass="scroller"
paginator="true"
paginatorMaxPages="9"
paginatorTableClass="paginator"
paginatorActiveColumnStyle="font-weight:bold;"
>
<f:facet name="first" >
<h:graphicImage url="/images/arrow-first.gif" border="1" />
</f:facet>
<f:facet name="last">
<h:graphicImage url="/images/arrow-last.gif" border="1" />
</f:facet>
<f:facet name="previous">
<h:graphicImage url="/images/arrow-previous.gif"
border="1" />
</f:facet>
<f:facet name="next">
<h:graphicImage url="/images/arrow-next.gif" border="1" />
</f:facet>
<f:facet name="fastforward">
<h:graphicImage url="/images/arrow-ff.gif" border="1" />
</f:facet>
<f:facet name="fastrewind">
<h:graphicImage url="/images/arrow-fr.gif" border="1" />
</f:facet>
</x:dataScroller>
<x:dataScroller id="scroller_information"
for="datatable"
rowsCountVar="rowsCount"
displayedRowsCountVar="displayedRowsCountVar"
firstRowIndexVar="firstRowIndex"
lastRowIndexVar="lastRowIndex"
pageCountVar="pageCount"
pageIndexVar="pageIndex"
>
<h:outputFormat value="{0} records found, displaying
{1} records, from {2} to {3}. Page {4} / {5}" styleClass="standard" >
<f:param value="#{rowsCount}" />
<f:param value="#{displayedRowsCountVar}" />
<f:param value="#{firstRowIndex}" />
<f:param value="#{lastRowIndex}" />
<f:param value="#{pageIndex}" />
<f:param value="#{pageCount}" />
</h:outputFormat>
</x:dataScroller>
On 8/9/05, Trevor Griffiths <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm somewhat of a newbie with JSF and I'm attempting to use the data
> scroller with a data table.
>
> I've tried to set a jsp page up in the same way as the example.
>
> When the table has more then 10 entries the pagination widget displays
> correctly.
> If I select the next page I end up with an empty table display (header
> only). The widget still displays but the buttons simply refresh the
> existing empty page.
>
> When I set up the jsp the only link that I could see between the table and
> the scroller(s) was the "for" parameter which I set to the id of x:datatable
>
> The scroller and table are a complete black box to me. I have no idea
> what's going on inside (and that's the way it should be for a component).
> Unfortunately, I also don't know whether my backing bean is supposed to
> do something (couldn't find the src for an example backing bean).
> Similarly what do the other parameters pageCountVar and
> pageIndexVar actually do? The explanation in the component definition
> didn't help me. Do I need to relate them to the table in some way?
>
> Any help (or pointers to other documentation) would be much appreciated.
>
> Thanks
>
> Trev...
>
>
>