[Bug #1269] Fix previous commit as it was not working properly

FEA: ItEr75S04BugFixing
This commit is contained in:
Manuel Rego Casasnovas 2011-11-17 14:51:19 +01:00
parent 6cbf124938
commit 4edfd0f2ab
2 changed files with 7 additions and 18 deletions

View file

@ -873,7 +873,10 @@ public class Planner extends HtmlMacroComponent {
}
public void updateCompletion(String progressType) {
getTaskList().updateCompletion(progressType);
TaskList taskList = getTaskList();
if (taskList != null) {
taskList.updateCompletion(progressType);
}
}
}

View file

@ -164,13 +164,9 @@ public class CompanyPlanningController implements Composer {
cbProgressTypes.setVisible(true);
Comboitem item = findListitemValue(cbProgressTypes,
getProgressTypeFromConfiguration());
if (item != null) {
cbProgressTypes.setSelectedItem(item);
planner.updateCompletion(((ProgressType) item.getValue())
.toString());
ProgressType progressType = getProgressTypeFromConfiguration();
if (progressType != null) {
planner.updateCompletion(progressType.toString());
}
}
@ -185,16 +181,6 @@ public class CompanyPlanningController implements Composer {
}
}
private Comboitem findListitemValue(Combobox listbox, ProgressType value) {
for (Object each : listbox.getChildren()) {
final Comboitem item = (Comboitem) each;
if (value.equals(item.getValue())) {
return item;
}
}
return null;
}
public ProgressType getProgressTypeFromConfiguration() {
return model.getProgressTypeFromConfiguration();
}