셀 테이블을 크레이트하고 SimplePager를 추가하는 다음 코드가 있습니다.GWT celltable 페이지 매김이 작동하지 않음
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;
}
}
페이저의 다음 버튼을 클릭하면 화면로드 만 표시됩니다. 누구든지 코드의 가능한 오류를 지적 할 수 있습니까 ??
같은 일이 일 –