use of org.fusesource.restygwt.client.Method in project mvp4g2-examples by mvp4g.
the class ListPresenter method onGotoList.
@EventHandler
public void onGotoList(String searchName, String searchCity) {
GWT.debugger();
ClientContext.get().getPersonService().search(new PersonSearch(searchName, searchCity), new MethodCallback<List<Person>>() {
@Override
public void onFailure(Method method, Throwable throwable) {
DomGlobal.alert("error: " + throwable.getMessage());
}
@Override
public void onSuccess(Method method, List<Person> persons) {
GWT.debugger();
view.setData(persons);
eventBus.setContent(view.asElement());
if (persons.size() == 0) {
eventBus.setStatus("No person found");
} else if (persons.size() == 1) {
eventBus.setStatus("Found one person");
} else {
eventBus.setStatus("Found " + Integer.toString(persons.size()) + " persons");
}
}
});
}
Aggregations