@Override
protected void event(UserRequest ureq, Controller source, Event event) {
if(runDENTable == source) {
//the link to enroll or cancel enrollment is clicked
if(event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
TableEvent tableEvent = (TableEvent)event;
if(tableEvent.getActionId().equals(DENRunTableDataModel.CMD_ENROLL_IN_DATE)) {
//do enroll
KalendarEvent calEvent = (KalendarEvent)runTableData.getObject(tableEvent.getRowId());
status = denManager.doEnroll(ureq.getIdentity(), calEvent, ores, courseNode);
if(!status.isEnrolled()) showError();
runDENTable.setTableDataModel(runTableData);
fireEvent(ureq, Event.DONE_EVENT);
// inform subscription context about changes
NotificationsManager.getInstance().markPublisherNews(subsContext, ureq.getIdentity());
} else if(tableEvent.getActionId().equals(DENRunTableDataModel.CMD_ENROLLED_CANCEL)) {
//cancel enrollment
KalendarEvent calEvent = (KalendarEvent)runTableData.getObject(tableEvent.getRowId());
DENStatus status = denManager.cancelEnroll(ureq.getIdentity(), calEvent, ores, courseNode);
if(!status.isCancelled()) showError();
runDENTable.setTableDataModel(runTableData);
fireEvent(ureq, Event.DONE_EVENT);
// inform subscription context about changes