use of org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent in project OpenOLAT by OpenOLAT.
the class UserSearchFlexiController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (source == backLink) {
flc.contextPut("noList", "false");
flc.contextPut("showButton", "false");
if (userTableModel != null) {
userTableModel.setObjects(new ArrayList<>());
tableEl.reset();
}
} else if (searchButton == source) {
if (validateForm(ureq)) {
getWindowControl().getWindowBackOffice().sendCommandTo(new ScrollTopCommand());
doSearch();
}
} else if (tableEl == source) {
if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
Identity chosenIdent = userTableModel.getObject(se.getIndex());
fireEvent(ureq, new SingleIdentityChosenEvent(chosenIdent));
}
} else {
super.formInnerEvent(ureq, source, event);
}
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent in project OpenOLAT by OpenOLAT.
the class GTAAvailableTaskController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (tableEl == source) {
if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
AvailableTask row = taskModel.getObject(se.getIndex());
if ("select".equals(se.getCommand())) {
doSelect(ureq, row);
}
}
} else if (source instanceof FormLink) {
FormLink link = (FormLink) source;
if ("description".equals(link.getCmd())) {
doDescription(ureq, (AvailableTask) link.getUserObject());
} else if ("preview-html".equals(link.getCmd())) {
String filename = (String) link.getUserObject();
doPreview(ureq, filename);
}
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent in project OpenOLAT by OpenOLAT.
the class CourseReminderListController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (addButton == source) {
doAddReminder(ureq);
} else if (source instanceof FormLink) {
FormLink link = (FormLink) source;
String cmd = link.getCmd();
if ("tools".equals(cmd)) {
ReminderRow row = (ReminderRow) link.getUserObject();
doOpenTools(ureq, row, link);
}
} else if (source == tableEl) {
if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
String cmd = se.getCommand();
ReminderRow row = tableModel.getObject(se.getIndex());
if ("edit".equals(cmd)) {
doEdit(ureq, row);
}
}
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent in project OpenOLAT by OpenOLAT.
the class AbstractPageListController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (tableEl == source) {
if (event instanceof FlexiTableSearchEvent) {
FlexiTableSearchEvent se = (FlexiTableSearchEvent) event;
loadModel(ureq, se.getSearch());
} else if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
String cmd = se.getCommand();
if ("up".equals(cmd)) {
PortfolioElementRow row = model.getObject(se.getIndex());
if (row.isPendingAssignment()) {
doMoveUpAssignment(ureq, row);
}
} else if ("down".equals(cmd)) {
PortfolioElementRow row = model.getObject(se.getIndex());
if (row.isPendingAssignment()) {
doMoveDownAssignment(ureq, row);
}
}
}
} else if (timelineSwitchOnButton == source) {
doSwitchTimelineOff();
} else if (timelineSwitchOffButton == source) {
doSwitchTimelineOn();
} else if (source instanceof FormLink) {
FormLink link = (FormLink) source;
String cmd = link.getCmd();
if ("open.full".equals(cmd)) {
PortfolioElementRow row = (PortfolioElementRow) link.getUserObject();
doOpenRow(ureq, row, false);
} else if ("comment".equals(cmd)) {
PortfolioElementRow row = (PortfolioElementRow) link.getUserObject();
doComment(ureq, row.getPage());
} else if ("close.section".equals(cmd)) {
PortfolioElementRow row = (PortfolioElementRow) link.getUserObject();
doConfirmCloseSection(ureq, row);
} else if ("reopen.section".equals(cmd)) {
PortfolioElementRow row = (PortfolioElementRow) link.getUserObject();
doConfirmReopenSection(ureq, row);
} else if ("edit.assignment".equals(cmd)) {
PortfolioElementRow row = (PortfolioElementRow) link.getUserObject();
doEditAssignment(ureq, row);
} else if ("delete.assignment".equals(cmd)) {
PortfolioElementRow row = (PortfolioElementRow) link.getUserObject();
doConfirmDeleteAssignment(ureq, row);
} else if ("move.assignment".equals(cmd)) {
PortfolioElementRow row = (PortfolioElementRow) link.getUserObject();
doMoveAssignment(ureq, row);
} else if ("start.assignment".equals(cmd)) {
PortfolioElementRow row = (PortfolioElementRow) link.getUserObject();
doStartAssignment(ureq, row);
} else if ("open.assignment".equals(cmd)) {
PortfolioElementRow row = (PortfolioElementRow) link.getUserObject();
doOpenAssignment(ureq, row);
} else if ("up.assignment".equals(cmd)) {
PortfolioElementRow row = (PortfolioElementRow) link.getUserObject();
doMoveUpAssignment(ureq, row);
} else if ("down.assignment".equals(cmd)) {
PortfolioElementRow row = (PortfolioElementRow) link.getUserObject();
doMoveDownAssignment(ureq, row);
}
} else if (source instanceof SingleSelection) {
SingleSelection startAssignment = (SingleSelection) source;
if (startAssignment.isOneSelected()) {
String selectedKey = startAssignment.getSelectedKey();
try {
Long key = Long.parseLong(selectedKey);
doStartAssignment(ureq, key);
} catch (Exception e) {
//
}
}
} else if (source == flc) {
if ("ONCLICK".equals(event.getCommand())) {
String category = ureq.getParameter("tag_select");
if (StringHelper.containsNonWhitespace(category)) {
tableEl.quickSearch(ureq, category);
}
}
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent in project OpenOLAT by OpenOLAT.
the class BinderPageListController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (tableEl == source) {
if (event instanceof FlexiTableRenderEvent) {
FlexiTableRenderEvent re = (FlexiTableRenderEvent) event;
if (re.getRendererType() == FlexiTableRendererType.custom) {
tableEl.sort(new SortKey(null, false));
}
} else if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
String cmd = se.getCommand();
if ("select-page".equals(cmd)) {
PortfolioElementRow row = model.getObject(se.getIndex());
if (row.isPendingAssignment()) {
doStartAssignment(ureq, row);
} else {
doOpenRow(ureq, row, false);
}
}
}
} else if (previousSectionLink == source) {
Section previousSection = (Section) previousSectionLink.getUserObject();
doFilterSection(previousSection);
} else if (nextSectionLink == source) {
Section nextSection = (Section) nextSectionLink.getUserObject();
doFilterSection(nextSection);
} else if (showAllSectionsLink == source) {
doShowAll();
} else if (newSectionButton == source) {
doCreateNewSection(ureq);
} else if (source instanceof FormLink) {
FormLink link = (FormLink) source;
String cmd = link.getCmd();
if ("new.entry".equals(cmd)) {
PortfolioElementRow row = (PortfolioElementRow) link.getUserObject();
doCreateNewPage(ureq, row.getSection());
} else if ("new.assignment".equals(cmd)) {
PortfolioElementRow row = (PortfolioElementRow) link.getUserObject();
doCreateNewAssignment(ureq, row.getSection());
}
}
super.formInnerEvent(ureq, source, event);
}
Aggregations