Hi!
Are there any techiques to collect a number of gwt-rpc service callback results?
I have a dialog window used to create new or edit existing object. These objects have a number of references to other object. So when user creating or editing an object he may pick one in the ListBox.
public class School {
private String name;
private String address;
}
public class Car {
private String model;
private String type;
}
public class Person {
private String firstName;
private String lastName;
private School school;
private Car firstCar;
}
When the dialog window appears on the screen it should request all available values for all referencing fields. These values are requested with AsyncCallback's via gwt-rpc, so I can handle it one-by-one.
service.getAllSchools(new AsyncCallback<List<School>>() {
@Override
public void onSuccess(List<School> result) {
fillSchoolListBox(result);
}
@Override
public void onFailure(Throwable caught) {
Window.alert("ups...");
}
});
...
service.getAllSchools(new AsyncCallback<List<Car>>() {
@Override
public void onSuccess(List<Car> result) {
fillCarListBox(result);
}
@Override
public void onFailure(Throwable caught) {
Window.alert("ups...");
}
});
How to get all result in one place? Thanks.