Skip to content

Commit

Permalink
MID-8120 fixed logging configuration table - new logger now on correc…
Browse files Browse the repository at this point in the history
…t page in table
  • Loading branch information
1azyman committed Sep 22, 2022
1 parent 3f9df98 commit 1b146de
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ private void loggerEditPerformed(AjaxRequestTarget target, IModel<PrismContainer
logger.setSelected(true);
}
}
getTable().goToLastPage();
target.add(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public class BoxedTablePanel<T> extends BasePanel<T> implements Table {
private String additionalBoxCssClasses = null;
private boolean isRefreshEnabled;
private List<IColumn<T, String>> columns;
private ISortableDataProvider provider;

//interval in seconds
private static final int DEFAULT_REFRESH_INTERVAL = 60;
Expand All @@ -81,6 +80,18 @@ public BoxedTablePanel(String id, ISortableDataProvider provider, List<IColumn<T
initLayout(columns, provider);
}

public void goToLastPage() {
long size = getDataTable().getDataProvider().size();
int itemsPerPage = getItemsPerPage();

long page = size / itemsPerPage;
if (size % itemsPerPage != 0) {
page++;
}

setCurrentPage(page);
}

public void setShowAsCard(boolean showAsCard) {
this.showAsCard = showAsCard;
}
Expand Down

0 comments on commit 1b146de

Please sign in to comment.