我使用的是GWT 2.5.1。我有一个CellTable,其中分页由SimplePager完成。我看到与SimplePager有关的以下问题。
我知道这些都是众所周知的问题,因为我在这个问题上做了很多研究。想知道GWT 2.5.1中是否还没有解决这个问题。有可用的包装吗?有解决这个问题的办法吗?我正在编写我的自定义寻呼机,它扩展了SimplePager,如下所示。
public class MySimplePager extends SimplePager {
public MySimplePager() {
this.setRangeLimited(true);
}
public MySimplePager(TextLocation location, Resources resources, boolean showFastForwardButton, int fastForwardRows, boolean showLastPageButton) {
super(location, resources, showFastForwardButton, fastForwardRows, showLastPageButton);
this.setRangeLimited(true);
}
@Override
public void setPageStart(int index) {
if (this.getDisplay() != null) {
Range range = getDisplay().getVisibleRange();
int pageSize = range.getLength();
if (!isRangeLimited() && getDisplay().isRowCountExact()) {
index = Math.min(index, getDisplay().getRowCount() - pageSize);
}
index = Math.max(0, index);
if (index != range.getStart()) {
getDisplay().setVisibleRange(index, pageSize);
}
}
}
}我正在实例化寻呼机如下:
SimplePager.Resources resources = GWT.create(SimplePager.Resources.class);
usersPager = new MySimplePager(SimplePager.TextLocation.CENTER, resources, false,10, true);但是,这根本行不通。奇怪的是,setPageStart()方法在任何时候都没有被调用。我在里面放了一些日志消息,但是没有显示出来。我在这里做错了什么或者失踪了什么吗?任何帮助都将不胜感激。
谢谢。
发布于 2014-01-24 07:35:20
我没有面对你的前两个问题。第三个问题出现在2.5.1 RC1版本中,但它在2.5.1版本中得到了纠正。
有克服这一问题的方法,但我忘了是什么。2)使用以下构造函数启用快速前进按钮和最后一页按钮
public SimplePager(TextLocation location, boolean showFastForwardButton,
boolean showLastPageButton)3)这是在最新版本中修正的。
欲知更多信息,请看这个。
https://stackoverflow.com/questions/21314780
复制相似问题