[Bug #987] Don't select hour type if there are no items in the list of hours type

FEA: ItEr74S04BugFixing
This commit is contained in:
Diego Pino Garcia 2011-04-15 13:29:03 +02:00
parent e012576195
commit 71082a7470
2 changed files with 10 additions and 0 deletions

View file

@ -268,6 +268,11 @@ public class CostCategoryCRUDController extends GenericForwardComposer
lbHoursType.renderAll();
lbHoursType.applyProperties();
if (lbHoursType.getItems().isEmpty()) {
row.appendChild(lbHoursType);
return;
}
// First time is rendered, select first item
TypeOfWorkHours type = hourCost.getType();
if (hourCost.isNewObject() && type == null) {

View file

@ -1169,6 +1169,11 @@ public class WorkReportCRUDController extends GenericForwardComposer implements
lbHoursType.renderAll();
lbHoursType.applyProperties();
if (lbHoursType.getItems().isEmpty()) {
row.appendChild(lbHoursType);
return;
}
// First time is rendered, select first item
TypeOfWorkHours type = workReportLine.getTypeOfWorkHours();
if (workReportLine.isNewObject() && type == null) {