Pagenation in GroupTable

Hi
I have used groupTable to display composit entities where I want the data is displayed in pages.
I have checked “rowcount” in xml file as follows:
image

but the whole table with >300 rows is loaded at run-time.

Here is the xml codes look like for the groupTable:

<groupTable id="realEstateProjectCostMeasureGroupTable"
            editable="true"
            height="100%"
            width="100%">
    <actions>
        <action id="create"
                invoke="onAddMeasure"/>
        <action id="edit"
                openType="DIALOG"/>
        <action id="remove"/>
    </actions>
    <columns>
        <column id="realEstateProjectWorkType"/>
        <column id="realEstateProjectWorkJob"/>
        <column id="description"/>
    </columns>
    <rows datasource="realEstateProjectCostMeasureDs"/>
    <rowsCount/>
</groupTable>

I have tried the following codes in the controller but getting NPE in the last line:

RowsCount rowsCount = componentsFactory.createComponent(RowsCount.class);
rowsCount.setAlignment(Alignment.BOTTOM_RIGHT);
rowsCount.setDatasource(realEstateProjectCostMeasureDs);
rowsCount.setOwner(realEstateProjectCostMeasureTable);
realEstateProjectCostMeasureDs.setMaxResults(50);
rowsCount.setDatasource(realEstateProjectCostMeasureDs);
realEstateProjectCostMeasureTable.setRowsCount(rowsCount);

Hi,

It seems, according to your screenshot, that the table is associated with a nested datasource. In this case, rowsCount only shows the total amount of items and pagination doesn’t work by design.

Regarding NPE that you get, could you please attach a demo project or, at least, share the full snippet of the screen descriptor and controller as well as entities relations.

Only known issue with rowsCount is UnsupportedOperationException for nested CollectionDatasource when use rowsCount · Issue #1899 · cuba-platform/cuba · GitHub.

Regards,
Gleb

Hi Gleb
Yes it is related to nested data source. is there any workaround way by that we can implement pagination in composit collection table?

Unfortunatelly, no