-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Here is my code for getSize() method:
@Override
public int getSize(param1, param2) {
return <database query result>;
}
Parameters in method call are filters, so when executing code in viewModel with implementation of AbstractListModel, this method is being called many times every time executing a query to a db. Thus, with ~26000 rows in table, it takes about 10 min for a page to render.
Is there any way to overcome this problem (maybe make zk not to call getSize() so often)?
When you do the query initially to get data from a database, you can store the size of the query result in your custom ListModel. Then you can just return the size without re-query every time.
@Override
public int getSize() {
return totalSize;
}
Asked: 2023-11-10 21:21:37 +0800
Seen: 6 times
Last updated: Nov 14