Search in sources :

Example 61 with MultipleSelectionElement

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;
}
Also used : MultipleSelectionElement(org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement) MultipleSelectionElementImpl(org.olat.core.gui.components.form.flexible.impl.elements.MultipleSelectionElementImpl)

Example 62 with MultipleSelectionElement

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;
}
Also used : MultipleSelectionElement(org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement) MultipleSelectionElementImpl(org.olat.core.gui.components.form.flexible.impl.elements.MultipleSelectionElementImpl)

Example 63 with MultipleSelectionElement

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;
}
Also used : MultipleSelectionElement(org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement) MultiSelectionTreeImpl(org.olat.core.gui.components.form.flexible.impl.elements.MultiSelectionTreeImpl)

Example 64 with MultipleSelectionElement

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;
}
Also used : MultipleSelectionElement(org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement) MultipleSelectionElementImpl(org.olat.core.gui.components.form.flexible.impl.elements.MultipleSelectionElementImpl)

Example 65 with MultipleSelectionElement

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);
}
Also used : MultipleSelectionElement(org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement) SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Aggregations

MultipleSelectionElement (org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement)136 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)22 ArrayList (java.util.ArrayList)20 TextElement (org.olat.core.gui.components.form.flexible.elements.TextElement)16 MultipleSelectionElementImpl (org.olat.core.gui.components.form.flexible.impl.elements.MultipleSelectionElementImpl)16 HashMap (java.util.HashMap)12 HashSet (java.util.HashSet)12 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)12 SingleSelection (org.olat.core.gui.components.form.flexible.elements.SingleSelection)10 FormItem (org.olat.core.gui.components.form.flexible.FormItem)8 Identity (org.olat.core.id.Identity)8 UserPropertyHandler (org.olat.user.propertyhandlers.UserPropertyHandler)8 SelectionEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)6 ICourse (org.olat.course.ICourse)6 Checkbox (org.olat.course.nodes.cl.model.Checkbox)6 VFSContainer (org.olat.core.util.vfs.VFSContainer)5 VFSItem (org.olat.core.util.vfs.VFSItem)5 Section (org.olat.modules.portfolio.Section)5 File (java.io.File)4 UserShortDescription (org.olat.admin.user.UserShortDescription)4