ItEr36S14CUAdministracionCategoriaCosteItEr35S15: modified the listener of the "type" field to set the "price" field to the default one
The code of the listener has also been cleaned. A validation has been removed because it's done in other point.
This commit is contained in:
parent
9f72725b7e
commit
073d60c501
1 changed files with 5 additions and 4 deletions
|
|
@ -226,14 +226,15 @@ public class CostCategoryCRUDController extends GenericForwardComposer
|
|||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
final Comboitem comboitem = autocomplete.getSelectedItem();
|
||||
if (comboitem == null) {
|
||||
throw new WrongValueException(autocomplete,
|
||||
_("Please, select an item"));
|
||||
}
|
||||
|
||||
// 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);
|
||||
}
|
||||
});
|
||||
row.appendChild(autocomplete);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue