Domanda

I'm trying to implement an apache trinidad table in my web application. My code in my xhtml file is:

<tr:table value="#{Search.persons}" var="row" rows="10" emptyText="#{res.noRecordsFound}"
    rowBandingInterval="1" rowSelection="none" first="0">
<tr:column>
    <f:facet name="header">
        <tr:outputText value="Id"/>
    </f:facet>
    <tr:outputText value="#{row.id}"/>
</tr:column>
<tr:column>
    <f:facet name="header">
        <tr:outputText value="#{labels['Person.lastName']}"/>
    </f:facet>
    <tr:outputText value="#{row.lastName}"/>
</tr:column>
<tr:column>
    <f:facet name="header">
        <tr:outputText value="#{labels['Person.name']}"/>
    </f:facet>
    <tr:outputText value="#{row.firstName}"/>
</tr:column>
</tr:table>

The total number of #{Search.persons} is 21 rows. I use the attribute rows to retrieve 10 rows. The table containing the first 10 rows is rendered successfully. The "problem" is that no navigation (pagination) links are created by the table component. Do I have to change or add something in my code?

È stato utile?

Soluzione

Your tr:table must be inside a form. If it's not, the navigation links won't show.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top