Search in sources :

Example 1 with CheckboxConfigRow

use of org.olat.course.nodes.cl.ui.CheckboxConfigRow in project OpenOLAT by OpenOLAT.

the class CheckboxListStepController method updateModel.

private void updateModel() {
    List<Checkbox> boxList = data.getCheckboxList();
    List<CheckboxConfigRow> rows = new ArrayList<>();
    for (Checkbox box : boxList) {
        rows.add(new CheckboxConfigRow(box, null));
    }
    model.setObjects(rows);
    boxTable.reset();
}
Also used : CheckboxConfigRow(org.olat.course.nodes.cl.ui.CheckboxConfigRow) Checkbox(org.olat.course.nodes.cl.model.Checkbox) ArrayList(java.util.ArrayList)

Example 2 with CheckboxConfigRow

use of org.olat.course.nodes.cl.ui.CheckboxConfigRow in project OpenOLAT by OpenOLAT.

the class CheckboxListStepController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (addLink == source) {
        Checkbox checkbox = new Checkbox();
        checkbox.setCheckboxId(UUID.randomUUID().toString());
        String title = translate("add.checkbox");
        doOpenEdit(ureq, checkbox, true, title);
    } else if (boxTable == source) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            String cmd = se.getCommand();
            if ("edit".equals(cmd)) {
                CheckboxConfigRow row = model.getObject(se.getIndex());
                doOpenEdit(ureq, row.getCheckbox(), false, translate("edit.checkbox"));
            }
        }
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : CheckboxConfigRow(org.olat.course.nodes.cl.ui.CheckboxConfigRow) Checkbox(org.olat.course.nodes.cl.model.Checkbox) SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)

Example 3 with CheckboxConfigRow

use of org.olat.course.nodes.cl.ui.CheckboxConfigRow in project openolat by klemens.

the class CheckboxListStepController method updateModel.

private void updateModel() {
    List<Checkbox> boxList = data.getCheckboxList();
    List<CheckboxConfigRow> rows = new ArrayList<>();
    for (Checkbox box : boxList) {
        rows.add(new CheckboxConfigRow(box, null));
    }
    model.setObjects(rows);
    boxTable.reset();
}
Also used : CheckboxConfigRow(org.olat.course.nodes.cl.ui.CheckboxConfigRow) Checkbox(org.olat.course.nodes.cl.model.Checkbox) ArrayList(java.util.ArrayList)

Example 4 with CheckboxConfigRow

use of org.olat.course.nodes.cl.ui.CheckboxConfigRow in project openolat by klemens.

the class CheckboxListStepController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (addLink == source) {
        Checkbox checkbox = new Checkbox();
        checkbox.setCheckboxId(UUID.randomUUID().toString());
        String title = translate("add.checkbox");
        doOpenEdit(ureq, checkbox, true, title);
    } else if (boxTable == source) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            String cmd = se.getCommand();
            if ("edit".equals(cmd)) {
                CheckboxConfigRow row = model.getObject(se.getIndex());
                doOpenEdit(ureq, row.getCheckbox(), false, translate("edit.checkbox"));
            }
        }
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : CheckboxConfigRow(org.olat.course.nodes.cl.ui.CheckboxConfigRow) Checkbox(org.olat.course.nodes.cl.model.Checkbox) SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)

Aggregations

Checkbox (org.olat.course.nodes.cl.model.Checkbox)4 CheckboxConfigRow (org.olat.course.nodes.cl.ui.CheckboxConfigRow)4 ArrayList (java.util.ArrayList)2 SelectionEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)2