use of de.gishmo.gwt.example.mvp4g2.simpleapplication.shared.dto.Person in project mvp4g2-examples by mvp4g.
the class DetailPresenter method onGotoDetail.
@EventHandler
public void onGotoDetail(long id) {
eventBus.setNavigationConfirmation(this);
try {
Person result = PersonService.get().get(id);
view.setUpData(result);
eventBus.setContent(view.asElement());
eventBus.setStatus("Edit person data");
} catch (PersonNotFoundException e) {
DomGlobal.window.alert("Panic!");
}
}
use of de.gishmo.gwt.example.mvp4g2.simpleapplication.shared.dto.Person in project mvp4g2-examples by mvp4g.
the class DetailView method createView.
public void createView() {
container = div().add(div().style("width: 100%;").add(div().css("headline").textContent("Details")).add(detailFirstName = new TextField("Firstname")).add(detailName = new TextField("Name")).add(detailStreet = new TextField("Street")).add(detailZip = new TextField("Zip")).add(detailCity = new TextField("City")).add(div().css("buttonBar").add(button().css("button").textContent("Save").on(click, event -> {
updateDetailForm();
getPresenter().doUpdate(person);
})).add(button().css("button").textContent("Revert").on(click, event -> {
getPresenter().doRevert();
})))).asElement();
}
use of de.gishmo.gwt.example.mvp4g2.simpleapplication.shared.dto.Person in project mvp4g2-examples by mvp4g.
the class ListPresenter method onGotoList.
@EventHandler
public void onGotoList(String searchName, String searchCity) {
List<Person> result = PersonService.get().get(new PersonSearch(searchName, searchCity));
view.resetTable();
view.setData(result);
eventBus.setContent(view.asElement());
if (result.size() == 0) {
eventBus.setStatus("No person found");
} else if (result.size() == 1) {
eventBus.setStatus("Found one person");
} else {
eventBus.setStatus("Found " + Integer.toString(result.size()) + " persons");
}
}
use of de.gishmo.gwt.example.mvp4g2.simpleapplication.shared.dto.Person in project mvp4g2-examples by mvp4g.
the class DetailView method createView.
public void createView() {
container = div().add(div().style("width: 100%;").add(div().css("headline").textContent("Details")).add(detailFirstName = new TextField("Firstname")).add(detailName = new TextField("Name")).add(detailStreet = new TextField("Street")).add(detailZip = new TextField("Zip")).add(detailCity = new TextField("City")).add(div().css("buttonBar").add(button().css("button").textContent("Save").on(click, event -> {
updateDetailForm();
getPresenter().doUpdate(person);
})).add(button().css("button").textContent("Revert").on(click, event -> {
getPresenter().doRevert();
})))).asElement();
}
use of de.gishmo.gwt.example.mvp4g2.simpleapplication.shared.dto.Person 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