1

I am trying to implement Pagination in JSF using Tomahawk. When the page is loaded, the table in the first page is populated with data. But, when I click on Next or Prev the table is empty. I don't see any javascript error in the browser. Following is the code from the jsp. Please let me know if I am missing something:

<t:dataTable id="tableid" value="#{SiteSearchCriteria.siteList}"
        var="item" border="1" rows="5" rowIndexVar="rowIndex"
        rowClasses="trobg1,trobg2">
        <h:column>
            <f:facet name="header">
                <h:outputText value="siteName"></h:outputText>
            </f:facet>
            <h:outputLabel value="#{item.siteName}"></h:outputLabel>
        </h:column>

        <h:column>
            <f:facet name="header">
                <h:outputText value="siteCLLI"></h:outputText>
            </f:facet>
            <h:outputLabel value="#{item.siteCLLI}"></h:outputLabel>
        </h:column>
</t:dataTable>

<t:dataScroller id="dataScrollerId" for="tableid" fastStep="10"
        pageIndexVar="pageIndex" renderFacetsIfSinglePage="true"
        pageCountVar="pageCount" paginator="true" paginatorMaxPages="9"
        immediate="true">
        <f:facet name="first">
            <t:outputText value="First"></t:outputText>
        </f:facet>
        <f:facet name="last">
            <t:outputText value="Last"></t:outputText>
        </f:facet>
        <f:facet name="previous">
            <t:outputText value="Previous"></t:outputText>
        </f:facet>
        <f:facet name="next">
            <t:outputText value="Next"></t:outputText>
        </f:facet>
</t:dataScroller>    
Mithun
  • 7,747
  • 6
  • 52
  • 68
  • 1
    The backing bean that I was using was in "request" scope. Hence, the data was not visible when I clicked on "Next". Changed the scope of backing bean to "Session" and things started to work. – Mithun Dec 21 '10 at 12:45
  • Please submit your comment as an answer (it solved my problem). If it's a comment it's harder to see it. – Igor Popov Oct 11 '11 at 05:41

1 Answers1

2

The backing bean that I was using was in "request" scope. Hence, the data was not visible when I clicked on "Next". Changed the scope of backing bean to "Session" and things started to work.

Mithun
  • 7,747
  • 6
  • 52
  • 68