vaadin / flow-components

Java counterpart of Vaadin Web Components
100 stars 66 forks source link

Change the lazyDataView.setItemCountEstimate(int estimatedItems) from int to long. #5593

Open sec-research-at opened 11 months ago

sec-research-at commented 11 months ago

We are using Vaadin to display large collections of data with a lazy loader and a full pageable backend.

While it isn't the way people should use it, we have the need to display Grids over the Integer.MAX_VALUE count. This isn't intended for daily usage,but it would be nice if this would be supported.

sec-research-at commented 11 months ago

FYI: We have a workaround for now - but it does make the grid scroll indicator less reliable:

` int estimatedEntries = 0;

    if(datasetPartition.getPartitionEntries() > Integer.MAX_VALUE){
        estimatedEntries = Integer.MAX_VALUE;
    }else{
        estimatedEntries = Math.toIntExact(datasetPartition.getPartitionEntries());
    }

    lazyDataView.setItemCountEstimate(estimatedEntries);`