Mike <[EMAIL PROTECTED]> wrote on 01/03/2006 10:00:30 AM:

> Hello all,
>
> I think I've almost gotten the paging component working with the
> sorting component for an ArrayList-based data model.
>
> If I remove the paging part from the JSP, the page still sorts and
> saves correctly.
>
> But, when I add the paging logic into the JSP, I get this message,
> which really doesn't help much. The log does refer to the JSP page,
> but the line number is bigger than the actual number of lines in the
> file so that's not helpful either.

Hi Mike,

Here's a barebones paging code (I removed all style for simplicity) which works for me:

<h:form id="contactscrollerpagerform">
        <t:saveState id="savesearchstate" value="#{search}" />
        <h:panelGrid styleClass="scrollerTableNoBorder"
                rendered="#{search.results}">
                <h:column>
                        <h:panelGrid id="contactInfoPanelGrid">

                                <f:facet name="header">
                                        <h:outputText value="Demographic search results" />
                                </f:facet>
                                <t:dataTable id="contactsearchdata"
                                        var="contact" value="#{search.matchingContacts}" rows="7"
                                        rowId="#{contact.id}" sortColumn="#{search.sort}"
                                        sortAscending="#{search.ascending}" preserveSort="true">

                                        <h:column>
                                        <f:facet name="header">
                                                <t:commandSortHeader columnName="lastname" arrow="true"
                                                        immediate="false">
                                                <h:outputText value="Last Name" />
                                                </t:commandSortHeader>
                                        </f:facet>
                                                <h:outputText value="#{contact.lastName}" />
                                        </h:column>
                                                <!--etc..add other columns here..-->
                                </t:dataTable>
                        </h:panelGrid>
                        <h:panelGrid>
                                <t:dataScroller id="scroll_1" for="contactsearchdata" fastStep="10"
                                        pageCountVar="pageCount" pageIndexVar="pageIndex"
                                        paginator="true" paginatorMaxPages="3"
                                        paginatorTableClass="paginator"
                                        paginatorActiveColumnStyle="font-weight:bold;">

                                        <f:facet name="first">
                                                <t:graphicImage url="images/arrow-first.gif" border="1" />
                                        </f:facet>
                                        <f:facet name="last">
                                                <t:graphicImage url="images/arrow-last.gif" border="1" />
                                        </f:facet>
                                        <f:facet name="previous">
                                                <t:graphicImage url="images/arrow-previous.gif" border="1" />
                                        </f:facet>
                                        <f:facet name="next">
                                                <t:graphicImage url="images/arrow-next.gif" border="1" />
                                        </f:facet>
                                </t:dataScroller>
                        </h:panelGrid>
                </h:column>
        </h:panelGrid>
</h:form>

You are right about the "for" of the datascroller needing to match the "id" of the datatable. Also note I didn't have have any actionListeners at all. Plus, the style stuff is in basic.css (at least it was in the version i downloaded a little while back. So as long as you import that style sheet at the top of your jsp, the style will be picked up.

Hope this helps,
Geeta

Reply via email to