Search in sources :

Example 1 with Method

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");
            }
        }
    });
}
Also used : PersonSearch(de.gishmo.gwt.example.mvp4g2.springboot.client.data.model.dto.PersonSearch) List(java.util.List) Method(org.fusesource.restygwt.client.Method) Person(de.gishmo.gwt.example.mvp4g2.springboot.client.data.model.dto.Person) EventHandler(com.github.mvp4g.mvp4g2.core.ui.annotation.EventHandler)

Aggregations

EventHandler (com.github.mvp4g.mvp4g2.core.ui.annotation.EventHandler)1 Person (de.gishmo.gwt.example.mvp4g2.springboot.client.data.model.dto.Person)1 PersonSearch (de.gishmo.gwt.example.mvp4g2.springboot.client.data.model.dto.PersonSearch)1 List (java.util.List)1 Method (org.fusesource.restygwt.client.Method)1