use of org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement in project openolat by klemens.
the class FormUIFactory method addCheckboxesDropdown.
public MultipleSelectionElement addCheckboxesDropdown(String name, String i18nLabel, FormItemContainer formLayout, String[] keys, String[] values, String[] cssClasses, String[] iconLeftCSS) {
MultipleSelectionElement mse = new MultipleSelectionElementImpl(name, Layout.dropdown);
mse.setKeysAndValues(keys, values, cssClasses, iconLeftCSS);
setLabelIfNotNull(i18nLabel, mse);
formLayout.add(mse);
return mse;
}
use of org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement in project openolat by klemens.
the class FormUIFactory method addCheckboxesHorizontal.
/**
* Create a multiple selection element with check-boxes horizontal aligned.
*
* @param name
* @param i18nLabel
* @param formLayout
* @param keys
* @param values
* @return
*/
public MultipleSelectionElement addCheckboxesHorizontal(String name, String i18nLabel, FormItemContainer formLayout, String[] keys, String[] values) {
MultipleSelectionElement mse = new MultipleSelectionElementImpl(name);
mse.setKeysAndValues(keys, values);
setLabelIfNotNull(i18nLabel, mse);
formLayout.add(mse);
return mse;
}
use of org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement in project openolat by klemens.
the class FormUIFactory method addTreeMultiselect.
/**
* Create a multiple selection element as a tree.
* @param name
* @param i18nLabel Can be null
* @param formLayout
* @param treemodel
* @param selectableFilter
* @return
*/
public MultipleSelectionElement addTreeMultiselect(String name, String i18nLabel, FormItemContainer formLayout, TreeModel treemodel, INodeFilter selectableFilter) {
MultipleSelectionElement mse = new MultiSelectionTreeImpl(name, treemodel, selectableFilter);
setLabelIfNotNull(i18nLabel, mse);
formLayout.add(mse);
return mse;
}
use of org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement in project openolat by klemens.
the class FormUIFactory method addCheckboxesVertical.
/**
* Create a multiple selection element with check-boxes that is rendered in vertical columns
* @param name
* @param i18nLabel
* @param formLayout
* @param keys
* @param values
* @param cssClasses
* @param columns
* @return
*/
public MultipleSelectionElement addCheckboxesVertical(String name, String i18nLabel, FormItemContainer formLayout, String[] keys, String[] values, String[] cssClasses, String[] iconLeftCSS, int columns) {
MultipleSelectionElement mse = new MultipleSelectionElementImpl(name, Layout.vertical, columns);
mse.setKeysAndValues(keys, values, cssClasses, iconLeftCSS);
setLabelIfNotNull(i18nLabel, mse);
formLayout.add(mse);
return mse;
}
use of org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement in project openolat by klemens.
the class TeacherRollCallController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (source == tableEl) {
if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
String cmd = se.getCommand();
TeacherRollCallRow row = tableModel.getObject(se.getIndex());
if ("all".equals(cmd)) {
doCheckAllRow(row);
}
}
} else if (source instanceof MultipleSelectionElement) {
MultipleSelectionElement check = (MultipleSelectionElement) source;
TeacherRollCallRow row = (TeacherRollCallRow) check.getUserObject();
if (row.getAuthorizedAbsence() == check) {
doAuthorizedAbsence(row, check);
if (check.isAtLeastSelected(1)) {
doCalloutReasonAbsence(ureq, check.getFormDispatchId() + "_C_0", row);
}
} else {
doCheckRow(row, check);
}
} else if (reopenButton == source) {
doReopen(ureq);
} else if (closeLectureBlocksButton == source) {
if (validateFormLogic(ureq)) {
saveLectureBlocks();
doConfirmCloseLectureBlock(ureq);
}
} else if (cancelLectureBlockButton == source) {
saveLectureBlocks();
doConfirmCancelLectureBlock(ureq);
} else if (source instanceof FormLink) {
FormLink link = (FormLink) source;
String cmd = link.getCmd();
if (cmd != null && cmd.startsWith("abs_reason_")) {
TeacherRollCallRow row = (TeacherRollCallRow) link.getUserObject();
doCalloutReasonAbsence(ureq, link.getFormDispatchId(), row);
}
}
super.formInnerEvent(ureq, source, event);
}
Aggregations