addTemplatesRow();
}
{
// Task
final FieldsetPanel fs = gridBuilder.newFieldset(getString("task"));
final TaskSelectPanel taskSelectPanel = new TaskSelectPanel(fs, new PropertyModel<TaskDO>(data, "task"), parentPage, "taskId") {
@Override
protected void selectTask(final TaskDO task)
{
super.selectTask(task);
refresh(); // Task was changed. Therefore update the kost2 list.
}
/**
* @see org.projectforge.web.task.TaskSelectPanel#onModelSelected(org.apache.wicket.ajax.AjaxRequestTarget,
* org.projectforge.task.TaskDO)
*/
@Override
protected void onModelSelected(final AjaxRequestTarget target, final TaskDO taskDO)
{
refresh();
super.onModelSelected(target, taskDO);
if (cost2ChoiceFieldset != null) {
target.add(cost2ChoiceFieldset.getFieldset());
}
}
};
taskSelectPanel.setAutocompleteOnlyTaskBookableForTimesheets(true);
fs.add(taskSelectPanel);
taskSelectPanel.init();
taskSelectPanel.setRequired(true);
}
if (cost2Exists == true) {
// Cost 2 entries does exist in the data-base.
cost2ChoiceFieldset = gridBuilder.newFieldset(getString("fibu.kost2"));
cost2ChoiceFieldset.getFieldset().setOutputMarkupId(true);