private void lookupDetails(final int groupDefinitionId) {
ResourceGroupDefinitionCriteria criteria = new ResourceGroupDefinitionCriteria();
criteria.addFilterId(groupDefinitionId);
if (groupDefinitionId == 0) {
GroupDefinition newGroupDefinition = new GroupDefinition();
setGroupDefinition(newGroupDefinition);
switchToEditMode();
} else {
GWTServiceLookup.getResourceGroupService().findGroupDefinitionsByCriteria(criteria,
new AsyncCallback<PageList<GroupDefinition>>() {
public void onFailure(Throwable caught) {
CoreGUI.getErrorHandler().handleError(
MSG.view_dynagroup_loadDefinitionFailure(String.valueOf(groupDefinitionId)), caught);
History.back();
}
public void onSuccess(PageList<GroupDefinition> result) {
if (result.size() == 0) {
CoreGUI.getErrorHandler().handleError(
MSG.view_dynagroup_loadDefinitionMissing(String.valueOf(groupDefinitionId)));
History.back();
} else {
GroupDefinition existingGroupDefinition = result.get(0);
setGroupDefinition(existingGroupDefinition);
switchToEditMode();
}
}
});