1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| public void getDocumentDataRemote(){
ServiceDefTarget endpoint = ( ServiceDefTarget )homeService;
String moduleRelativeURL = GWT.getModuleBaseURL()+"home";
endpoint.setServiceEntryPoint( moduleRelativeURL );
final AsyncCallback<List<Document>> callback = new AsyncCallback<List<Document>>() {
public void onFailure(Throwable caught) {
MessageBox.alert("Remote Procedure Call - Failure");
}
public void onSuccess(List<Document> list){
int i = 0;
Object[][] documentList = new Object[list.size()][];
for(Document d : list){
documentList[i] = new Object[]{d.getTitle(), d.getPath(), d.getPubDate(), d.getDescription()};
//documentList[i] = new Object[]{d,"url", d, d};
i++;
}
grid = new DocumentGrid().generateDocumentGrid(documentList);
setHome();
}
};
homeService.searchDocument(callback);
} |
Partager