Skip to content

Commit

Permalink
fixed impl
Browse files Browse the repository at this point in the history
Issue #884
  • Loading branch information
rsoika committed Nov 8, 2024
1 parent 5b9808c commit 04f44ac
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public class ViewController implements Serializable {
private boolean endOfList = false;
private boolean loadStubs = true;
private long totalCount = 0;
private long totalPages = 0;

private static final Logger logger = Logger.getLogger(ViewController.class.getName());

Expand Down Expand Up @@ -191,6 +192,10 @@ public long getTotalCount() {
return totalCount;
}

public long getTotalPages() {
return totalPages;
}

/**
* Returns the current view result. The returned result set is defined by the
* current query definition.
Expand All @@ -201,7 +206,6 @@ public long getTotalCount() {
* @throws QueryException
*/
public List<ItemCollection> loadData() throws QueryException {

String _query = getQuery();

if (_query == null || _query.isEmpty()) {
Expand All @@ -225,6 +229,7 @@ public List<ItemCollection> loadData() throws QueryException {
// The end of a list is reached when the size is below or equal the
// pageSize. See issue #287
totalCount = documentService.count(_query);
totalPages = totalCount / getPageSize();
if (result.size() < getPageSize()) {
setEndOfList(true);
} else {
Expand Down

0 comments on commit 04f44ac

Please sign in to comment.