Hi, I have a problem when trying to create pagination for a composition field of an object.
This is my instance xml:
<instance id="purchaseOrderDc" class="com.fpt.scf.entity.PurchaseOrder" provided="true">
<fetchPlan extends="_base">
<property name="bank" fetchPlan="_base"/>
<property name="bankBranch" fetchPlan="_base"/>
<property name="scfContract" fetchPlan="_base"/>
<property name="anchor" fetchPlan="_base"/>
<property name="distributor" fetchPlan="_base"/>
<property name="currency" fetchPlan="_base"/>
<property name="poItems" fetchPlan="_base"/>
<property name="poDeliveries" fetchPlan="_base"/>
</fetchPlan>
<loader id="purchaseOrderDl" provided="true"/>
<collection id="itemsDc" property="poItems"/>
<collection id="poDeliveriesDc" property="poDeliveries"/>
</instance>
And I want to create a pagination for the collection “itemsDc” (“poItems” is a composition field of entity “PurchaseOrder”)
I tried to use: simplePagination and pagination but both have the same result like the picture below:
<simplePagination id="simplePagination" itemsPerPageVisible="true" autoLoad="true"
itemsPerPageOptions="10, 20, 30"
itemsPerPageDefaultValue="20"/>
<pagination itemsPerPageVisible="true" itemsPerPageDefaultValue="20" itemsPerPageOptions="10,20,30"
align="MIDDLE_RIGHT" maxVisiblePages="3" id="pagination">
<containerProvider dataContainer="itemsDc"/>
</pagination>
There are 2 problems:
- The table has total 11 rows but on init, the row/page is set to “3647” (I don’t know where this number comes from)
- When I set row/page = 10, it does not paginate, there is only 1 page with 11 rows.
Pls help me to create a pagination for a Collection Property. Thanks