Search in sources :

Example 11 with FormEvent

use of org.olat.core.gui.components.form.flexible.impl.FormEvent in project openolat by klemens.

the class AttributeEasyRowAdderController method event.

@Override
protected void event(final UserRequest ureq, final Controller source, final Event event) {
    if (event instanceof FormEvent) {
        final FormEvent fe = (FormEvent) event;
        final FormItem sourceItem = fe.getFormItemSource();
        final String compName = sourceItem.getName();
        if (columnAddRow.contains(compName)) {
            // add link clicked
            final int clickPos = ((Integer) sourceItem.getUserObject()).intValue();
            addRowAt(clickPos + 1);
        } else if (columnRemoveRow.contains(compName)) {
            // remove link clicked
            final int clickPos = ((Integer) sourceItem.getUserObject()).intValue();
            removeRowAt(clickPos);
        }
    }
}
Also used : FormEvent(org.olat.core.gui.components.form.flexible.impl.FormEvent) FormItem(org.olat.core.gui.components.form.flexible.FormItem)

Example 12 with FormEvent

use of org.olat.core.gui.components.form.flexible.impl.FormEvent in project openolat by klemens.

the class ResumeController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (source.equals(noButton)) {
        savePreferences(ureq, "none");
        fireEvent(ureq, new Event("no"));
    } else if (source.equals(landingButton)) {
        savePreferences(ureq, "none");
        fireEvent(ureq, new Event("landing"));
    }
}
Also used : FormEvent(org.olat.core.gui.components.form.flexible.impl.FormEvent) Event(org.olat.core.gui.control.Event)

Example 13 with FormEvent

use of org.olat.core.gui.components.form.flexible.impl.FormEvent in project OpenOLAT by OpenOLAT.

the class CheckboxEditController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (deleteLink == source) {
        fireEvent(ureq, new Event("delete"));
        if (courseNode != null) {
            ThreadLocalUserActivityLogger.log(CourseLoggingAction.CHECKLIST_CHECKBOX_DELETED, getClass(), LoggingResourceable.wrap(courseNode), LoggingResourceable.wrapNonOlatResource(StringResourceableType.checkbox, checkbox.getCheckboxId(), checkbox.getTitle()));
        }
    } else if (downloadFileLink == source) {
        doDownloadFile(ureq);
    } else if (deleteFileLink == source) {
        deleteFile();
    } else if (awardPointEl == source) {
        pointsEl.setVisible(withScore && awardPointEl.isAtLeastSelected(1));
    } else if (fileEl == source) {
        String filename = fileEl.getUploadFileName();
        downloadFileLink.setI18nKey(filename);
        downloadFileLink.setEnabled(false);
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : FormEvent(org.olat.core.gui.components.form.flexible.impl.FormEvent) Event(org.olat.core.gui.control.Event)

Example 14 with FormEvent

use of org.olat.core.gui.components.form.flexible.impl.FormEvent in project openolat by klemens.

the class EPViewModeController method formInnerEvent.

/**
 * @see org.olat.core.gui.components.form.flexible.impl.FormBasicController#formInnerEvent(org.olat.core.gui.UserRequest, org.olat.core.gui.components.form.flexible.FormItem, org.olat.core.gui.components.form.flexible.impl.FormEvent)
 */
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (source == tableLink || source == detailsLink) {
        FormLink link = (FormLink) source;
        if (!link.getCmd().equals(userPrefsMode)) {
            String newUserPrefsMode = link.getCmd();
            ePFMgr.setUsersPreferedArtefactViewMode(getIdentity(), newUserPrefsMode, context);
            userPrefsMode = newUserPrefsMode;
            fireEvent(ureq, new Event(VIEWMODE_CHANGED_EVENT_CMD));
        }
    }
}
Also used : Event(org.olat.core.gui.control.Event) FormEvent(org.olat.core.gui.components.form.flexible.impl.FormEvent) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Example 15 with FormEvent

use of org.olat.core.gui.components.form.flexible.impl.FormEvent in project openolat by klemens.

the class FormToggleImpl method dispatchFormRequest.

@Override
public void dispatchFormRequest(UserRequest ureq) {
    toggle();
    getRootForm().fireFormEvent(ureq, new FormEvent(Event.DONE_EVENT, this, FormEvent.ONCLICK));
}
Also used : FormEvent(org.olat.core.gui.components.form.flexible.impl.FormEvent)

Aggregations

FormEvent (org.olat.core.gui.components.form.flexible.impl.FormEvent)16 Event (org.olat.core.gui.control.Event)8 FormItem (org.olat.core.gui.components.form.flexible.FormItem)4 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)4 BigDecimal (java.math.BigDecimal)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 List (java.util.List)2 Map (java.util.Map)2 Predicate (java.util.function.Predicate)2 UserRequest (org.olat.core.gui.UserRequest)2 Component (org.olat.core.gui.components.Component)2 FormItemContainer (org.olat.core.gui.components.form.flexible.FormItemContainer)2 FlexiTableElement (org.olat.core.gui.components.form.flexible.elements.FlexiTableElement)2 FormBasicController (org.olat.core.gui.components.form.flexible.impl.FormBasicController)2 DefaultFlexiColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)2 FlexiTableColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel)2 FlexiTableDataModelFactory (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableDataModelFactory)2 SelectionEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)2 Link (org.olat.core.gui.components.link.Link)2