我有以下代码,它创建一个单元格表并将 SimplePager 添加到其中。
public class CellTableTestClass {
private VerticalPanel applicationPanel = new VerticalPanel();
private CellTable<Contact> cellTable = new CellTable<Contact>();
public VerticalPanel createContent() {
List<Contact> list=Arrays.asList(new Contact("John","123 Fourth Road"), new Contact("Mary", "222 Lancer Lane"), new Contact("Zander", "94 Road Street"), new Contact("Harry","303 Shakti"));
cellTable.addColumn(new TextColumn<Contact>() {
@Override
public String getValue(Contact object) {
return object.name;
}
}, "Log Name");
cellTable.addColumn(new TextColumn<Contact>() {
@Override
public String getValue(Contact object) {
return object.address;
}
}, "Size");
// create a pager, giving it a handle to the CellTable
SimplePager.Resources pagerResources =
GWT.create(SimplePager.Resources.class);
SimplePager pager = new SimplePager(TextLocation.CENTER,
pagerResources, true, 0, true);
pager.setDisplay(cellTable);
pager.setPageSize(2);
cellTable.setRowData(0,list);
cellTable.setRowCount(list.size());
// add the Pager to the dialog
applicationPanel.add(pager);
applicationPanel.add(new HTML("<hr />"));
applicationPanel.add(cellTable);
return applicationPanel;
}
}
当我单击寻呼机的下一个按钮时,它仅显示加载屏幕。谁能指出代码中可能存在的错误?