Commit b9eb6505 authored by Axel Brand's avatar Axel Brand Committed by daeva

Gojara

- fix pagination

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@13712 b35dd754-fafc-0310-a699-88a17e54d16e
parent f4ec3d8b
......@@ -90,7 +90,10 @@
// we now know current_page is in valid range, so set it for computation
current_page -= 1;
numOfPages += 1;
int next_items = (current_page * 100) + 99;
// this will be our sublist starting index, 0, 100, 200 ...
int current_index = current_page * 100;
//ending index, 99, 199 etc, when next items > numOfSessions we have reached last page, set proper index so we have no out of bounds
int next_items = current_index + 100;
if (next_items > numOfSessions)
next_items = numOfSessions;
%>
......@@ -123,7 +126,8 @@
</thead>
<tbody>
<%
for (SessionEntry registration : registrations) {
// sublist TOindex has to be +1, so 0,100 is item 0 - 99
for (SessionEntry registration : registrations.subList(0 , next_items)) {
%>
<tr class="jive-odd">
<td><a
......
......@@ -75,7 +75,8 @@
// we now know current_page is in valid range, so set it for computation
current_page -= 1;
numOfPages += 1;
int next_items = (current_page * 100) + 99;
int current_index = (current_page * 100);
int next_items= current_index + 100;
if (next_items > numOfSessions)
next_items = numOfSessions;
%>
......@@ -103,7 +104,7 @@
</thead>
<tbody>
<%
for (GatewaySession gwsession : gwSessions.subList(current_page * 100, next_items)) {
for (GatewaySession gwsession : gwSessions.subList(current_index, next_items)) {
%>
<tr class="jive-odd">
<td><a
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment