我正在使用本教程來解釋asyncdataprovider的用法以創建單元格http://www.mytechtip.com/2010/11/gwt-celltable-example-using_8168.html。教程提到您可以從服務器返回對象列表。如何從GWT中的服務器返回對象列表
// Associate an async data provider to the table
AsyncDataProvider<Contact> provider = new AsyncDataProvider<Contact>() {
@Override
protected void onRangeChanged(HasData<Contact> display) {
final int start = display.getVisibleRange().getStart();
int length = display.getVisibleRange().getLength();
AsyncCallback<List<Contact>> callback = new AsyncCallback<List<Contact>>() {
@Override
public void onFailure(Throwable caught) {
Window.alert(caught.getMessage());
}
@Override
public void onSuccess(List<Contact> result) {
updateRowData(start, result);
}
};
// The remote service that should be implemented
remoteService.fetchPage(start, length, callback);
}
};
有人能告訴我如何從服務器返回對象列表。
非常感謝。 – Ashish