Why are the next / last GWT SimplePager buttons disabled only if the range is limited or if the number of lines is inaccurate?

Using GWT 2.5.1, SimplePager.java has this method:

@Override protected void onRangeOrRowCountChanged() { HasRows display = getDisplay(); label.setText(createText()); // Update the prev and first buttons. setPrevPageButtonsDisabled(!hasPreviousPage()); // Update the next and last buttons. if (isRangeLimited() || !display.isRowCountExact()) { setNextPageButtonsDisabled(!hasNextPage()); setFastForwardDisabled(!hasNextPages(getFastForwardPages())); } } 

Why are the following / last buttons on / off only if the range is limited or if the number of lines is not accurate? I have a pager set to a limited false, and my asynchronous message data provider indicates that the line count is accurate when I update the line count. With this setting, the next / last paging buttons will NEVER be updated!

Am I just using it wrong or is it a mistake?

I worked on the problem by subclassing SimplePager to allow me this block at the bottom of onRangeOrRowCountChanged ():

  @Override protected void onRangeOrRowCountChanged() { boolean rangeLimited = isRangeLimited(); super.setRangeLimited(true); super.onRangeOrRowCountChanged(); super.setRangeLimited(rangeLimited); } 
+4
source share
1 answer

AIUI, if the range is not limited, you explicitly allow the pager to go beyond the available data and display blank pages.

If the line counter is not accurate, the next button should be turned on because hasNextPage will return true (fast forward will be disabled, although if it goes beyond the known, although inaccurate, number of lines), this refers to whether the range is limited or not that may or may not be a mistake.

+4
source

Source: https://habr.com/ru/post/1484429/


All Articles