ItEr37S12CUAdministracionCategoriaCosteItEr36S14: fixed the exception thrown when the combobox for TypeOfWorkHours is null

This commit is contained in:
Jacobo Aragunde Pérez 2009-12-02 20:58:42 +01:00 committed by Javier Moran Rua
parent 698a43a819
commit e469b4a9ee

View file

@ -227,14 +227,16 @@ public class CostCategoryCRUDController extends GenericForwardComposer
public void onEvent(Event event) throws Exception {
final Comboitem comboitem = autocomplete.getSelectedItem();
// Update hourCost
HourCost hourCost = (HourCost) row.getValue();
hourCost.setType((TypeOfWorkHours) comboitem.getValue());
row.setValue(hourCost);
if(comboitem != null) {
// Update hourCost
HourCost hourCost = (HourCost) row.getValue();
hourCost.setType((TypeOfWorkHours) comboitem.getValue());
row.setValue(hourCost);
// Update the hourPrice in the hourCost
hourCost.setPriceCost(((TypeOfWorkHours) comboitem.getValue()).getDefaultPrice());
Util.reloadBindings(listHourCosts);
// Update the hourPrice in the hourCost
hourCost.setPriceCost(((TypeOfWorkHours) comboitem.getValue()).getDefaultPrice());
Util.reloadBindings(listHourCosts);
}
}
});
row.appendChild(autocomplete);