tags:

views:

28

answers:

2

tomahawk dataScroller show only:

|<  <<  <       >   >>  >|

and not divides table on pages, shows all together

below part of jsp page:

<t:dataTable
    id="resultTable"
    value="#{customerSearchResults}"
    var="customerInfo" >
    <h:column>
        <f:facet name="header">
            <h:outputText value="Account #" />
        </f:facet>
        <h:outputText value="#{customerInfo.accountNumber}" />
    </h:column>
    <h:column>
        <f:facet name="header">
            <h:outputText value="Customer Name" />
        </f:facet>
        <h:outputText value="#{customerInfo.name}" />
    </h:column>
</t:dataTable>
<t:dataScroller 
    id="paginatorForResTable" 
    for="resultTable" 
    fastStep="10"
    paginatorMaxPages="9" 
    renderFacetsIfSinglePage="true"
    paginator="true"
    immediate="true"
    >
    <f:facet name="first">
        <h:outputText value="|&lt;" />
    </f:facet>
    <f:facet name="previous">
        <h:outputText value="&lt;" />
    </f:facet>
    <f:facet name="next">
        <h:outputText value="&gt;" />
    </f:facet>
    <f:facet name="last">
        <h:outputText value="&gt;|" />
    </f:facet>
    <f:facet name="fastforward">
        <h:outputText value="&gt;&gt;" />
    </f:facet>
    <f:facet name="fastrewind">
        <h:outputText value="&lt;&lt;" />
    </f:facet>
</t:dataScroller>

Does anyone know where is problem?

A: 

You didn't set twp important attribuites:

  • pageIndexVar - "A parameter name, under which the actual page index is set in request scope similar to the var parameter."

  • pageCountVar - "A parameter name, under which the actual page count is set in request scope similar to the var parameter"

These should point to a property of a bean of yours. For example #{customerBean.pageIndex}

Bozho
How this two attributes can help in my case?I saw few examples without this attributes that worked well.Anyway thanks
nahab
A: 

It was a really dumb question.

Adding attribute rows to t:dataTable helps in my case:

<t:dataTable
    id="resultTable"
    rows="10"
    value="#{customerSearchResults}"
    var="customerInfo" >
    <h:column>
        <f:facet name="header">
            <h:outputText value="Account #" />
        </f:facet>
        <h:outputText value="#{customerInfo.accountNumber}" />
    </h:column>
    <h:column>
        <f:facet name="header">
            <h:outputText value="Customer Name" />
        </f:facet>
        <h:outputText value="#{customerInfo.name}" />
    </h:column>
</t:dataTable>
nahab