use of org.activityinfo.legacy.shared.command.result.CountryResult in project activityinfo by bedatadriven.
the class NewDbDetailsPage method loadCountries.
private void loadCountries() {
loadCountries.setEnabled(false);
countryField.setShowValidationMessage(false);
dispatcher.execute(new GetCountries(), new AsyncCallback<CountryResult>() {
@Override
public void onFailure(Throwable caught) {
loadCountries.setEnabled(true);
countryField.showValidationMessage(I18N.CONSTANTS.failedToLoadCountries());
loadCountries.setVisible(true);
}
@Override
public void onSuccess(CountryResult result) {
loadCountries.setVisible(false);
for (CountryDTO countryDTO : result.getData()) {
country.addItem(countryDTO.getName(), Integer.toString(countryDTO.getId()));
}
country.update();
}
});
}
Aggregations