Skip to content

Commit

Permalink
paging navigation for disabled counting
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Sep 17, 2019
1 parent 93d83a8 commit 68026c0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Expand Up @@ -248,6 +248,14 @@ public String getObject() {
protected void onPageChanged(AjaxRequestTarget target, long page) {
target.add(count);
}

@Override
protected boolean isCountingDisabled(){
if (dataTable.getDataProvider() instanceof SelectableBeanObjectDataProvider){
return !((SelectableBeanObjectDataProvider)dataTable.getDataProvider()).isUseObjectCounting();
}
return super.isCountingDisabled();
}
};
footerContainer.add(nb2);

Expand Down
Expand Up @@ -273,7 +273,7 @@ public void onClick(AjaxRequestTarget target) {

@Override
public boolean isEnabled() {
return BooleanUtils.isTrue(showPageListingModel.getObject()) && isLastEnabled();
return !isCountingDisabled() && BooleanUtils.isTrue(showPageListingModel.getObject()) && isLastEnabled();
}
});
last.add(lastLink);
Expand Down Expand Up @@ -330,4 +330,8 @@ private void pageLinkPerformed(AjaxRequestTarget target, long page) {

protected void onPageChanged(AjaxRequestTarget target, long page) {
}

protected boolean isCountingDisabled(){
return false;
}
}

0 comments on commit 68026c0

Please sign in to comment.