* Append Selectbox of @{link TypeOfWorkHours} to row
*
* @param row
*/
private void appendHoursType(final Row row) {
final HourCost hourCost = (HourCost) row.getValue();
final Listbox lbHoursType = new Listbox();
lbHoursType.setMold("select");
lbHoursType.setModel(allHoursType);
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) {
Listitem item = lbHoursType.getItemAtIndex(0);
item.setSelected(true);
setHoursType(hourCost, item);
} else {
// If hoursCost has a type, select item with that type