Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Commit 0e7bcd3

Browse files
author
Tim Sowers
committed
Pagination issue; (DOECODE-980)
1 parent 6a38af1 commit 0e7bcd3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/gov/osti/doecode/entity/SearchFunctions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ private static ObjectNode getPaginationData(ObjectNode search_form_data, long nu
471471
long rows = search_form_data.findPath("rows").asLong(0);
472472

473473
long page = ((int) (start / rows) + 1);
474-
long max_pages = ((int) (num_found / rows) + 1);
474+
long max_pages = ((int) java.lang.Math.ceil(num_found / (double) rows));
475475

476476
return_data.put("pagination_btn_prev_disabled", page < 2);
477477
return_data.put("pagination_btn_next_disabled", (start + rows >= num_found));
@@ -727,7 +727,7 @@ public static ArrayNode getSearchBreadcrumbTrailList(ObjectNode search_form_data
727727
long rows = search_form_data.findPath("rows").asLong(0);
728728

729729
long page = ((int) (start / rows) + 1);
730-
long max_pages = ((int) (num_found / rows) + 1);
730+
long max_pages = ((int) java.lang.Math.ceil(num_found / (double) rows));
731731

732732
if (max_pages > 1) {
733733
return_data.add("&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;Page&nbsp;" + Long.toString(page) + "&nbsp;of&nbsp;"

0 commit comments

Comments
 (0)