Search in sources :

Example 1 with FormSubmit

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

the class DENDatesForm method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    // determine if FormController is in CREATE_DATES_LAYOUT mode
    boolean createsDateLayout = layout == CREATE_DATES_LAYOUT;
    // create form elements
    subjectTE = uifactory.addTextElement("subject", "config.dates.subject", 25, "", formLayout);
    subjectTE.setDisplaySize(25);
    setupTextElementDependingOn(createsDateLayout, subjectTE);
    locationTE = uifactory.addTextElement("location", "config.dates.location", 25, "", formLayout);
    locationTE.setDisplaySize(25);
    setupTextElementDependingOn(createsDateLayout, locationTE);
    commentTE = uifactory.addTextElement("comment", "config.dates.comment", 100, "", formLayout);
    commentTE.setDisplaySize(25);
    commentTE.setRegexMatchCheck("[^\"\\{\\}]*", "form.error.format");
    commentTE.showError(false);
    // Label of duration is depending on EDIT_SINGLE_DAE_LAYOUT
    String durationTELabel = layout == EDIT_SINGLE_DATE_LAYOUT ? "config.dates.duration.single" : "config.dates.duration";
    durationTE = uifactory.addTextElement("duration", durationTELabel, 5, "00:00", formLayout);
    durationTE.setDisplaySize(5);
    durationTE.setRegexMatchCheck("\\d{1,2}:\\d\\d", "form.error.format");
    durationTE.setExampleKey("config.dates.duration.example", null);
    durationTE.setNotEmptyCheck("form.error.notempty");
    durationTE.setMandatory(true);
    durationTE.setEnabled(showDurationTE);
    durationTE.setVisible(showDurationTE);
    durationTE.showError(false);
    pauseTE = uifactory.addTextElement("pause", "config.dates.pause", 5, "00:00", formLayout);
    pauseTE.setDisplaySize(5);
    pauseTE.setRegexMatchCheck("\\d{1,2}:\\d\\d", "form.error.format");
    pauseTE.setExampleKey("config.dates.pause.example", null);
    pauseTE.setNotEmptyCheck("form.error.notempty");
    pauseTE.setMandatory(true);
    pauseTE.setEnabled(showPauseTE);
    pauseTE.setVisible(showPauseTE);
    retakeTE = uifactory.addTextElement("retake", "config.dates.retakes", 4, "1", formLayout);
    retakeTE.setDisplaySize(4);
    retakeTE.setRegexMatchCheck("^[1-9][0-9]*", "form.error.format");
    retakeTE.setMandatory(true);
    retakeTE.setNotEmptyCheck("form.error.notempty");
    retakeTE.setEnabled(showRetakeTE);
    retakeTE.setVisible(showRetakeTE);
    beginDateChooser = uifactory.addDateChooser("begin", "config.dates.begin", null, formLayout);
    beginDateChooser.setNotEmptyCheck("form.error.notempty");
    beginDateChooser.setValidDateCheck("form.error.date");
    beginDateChooser.setMandatory(true);
    beginDateChooser.setDisplaySize(20);
    beginDateChooser.setDateChooserTimeEnabled(true);
    beginDateChooser.setExampleKey("config.dates.begin.example", null);
    beginDateChooser.setEnabled(showBeginDateChooser);
    beginDateChooser.setVisible(showBeginDateChooser);
    beginDateChooser.setDate(new Date());
    beginDateChooser.showError(false);
    participantsTE = uifactory.addTextElement("participants", "config.dates.participants", 4, "", formLayout);
    participantsTE.setDisplaySize(4);
    if (layout == CREATE_DATES_LAYOUT) {
        participantsTE.setRegexMatchCheck("^[1-9][0-9]*", "form.error.format");
        participantsTE.setNotEmptyCheck("form.error.notempty");
        participantsTE.setMandatory(true);
    } else {
        participantsTE.setRegexMatchCheck("(^[1-9][0-9]*)?$", "form.error.format");
        participantsTE.setMandatory(false);
    }
    participantsTE.showError(false);
    moveTE = uifactory.addTextElement("move", "config.dates.move", 6, "+00:00", formLayout);
    moveTE.setDisplaySize(6);
    moveTE.setRegexMatchCheck("[-+]\\d\\d:\\d\\d", "form.error.format");
    moveTE.setNotEmptyCheck("form.error.notempty");
    moveTE.setExampleKey("config.dates.move.example", null);
    moveTE.setMandatory(true);
    moveTE.setEnabled(showMoveTE);
    moveTE.setVisible(showMoveTE);
    moveTE.showError(false);
    if (layout == EDIT_SINGLE_DATE_LAYOUT || layout == EDIT_MULTIPLE_DATES_LAYOUT)
        submitBtn = new FormSubmit("submitBtn", "config.dates.save");
    else
        submitBtn = new FormSubmit("submitBtn", "dates.table.edit.save");
    formLayout.add(submitBtn);
}
Also used : FormSubmit(org.olat.core.gui.components.form.flexible.impl.elements.FormSubmit) Date(java.util.Date)

Example 2 with FormSubmit

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

the class DENEditForm method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    Boolean initialCancelEnrollEnabled = (Boolean) moduleConfig.get(ENCourseNode.CONF_CANCEL_ENROLL_ENABLED);
    enableCancelEnroll = uifactory.addCheckboxesHorizontal("enableCancelEnroll", "form.enableCancelEnroll", formLayout, new String[] { "ison" }, new String[] { "" });
    enableCancelEnroll.select("ison", initialCancelEnrollEnabled);
    subm = new FormSubmit("subm", "submit");
    formLayout.add(subm);
}
Also used : FormSubmit(org.olat.core.gui.components.form.flexible.impl.elements.FormSubmit)

Example 3 with FormSubmit

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

the class WimbaEditForm method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    // options
    String[] optionKeys = new String[] { OPTION_GUEST_ACCESS };
    String[] optionVals = new String[] { translate(OPTION_GUEST_ACCESS) };
    multiSelectOptions = uifactory.addCheckboxesVertical("vc.options", "vc.options.label", formLayout, optionKeys, optionVals, 1);
    multiSelectOptions.select(OPTION_GUEST_ACCESS, config.isGuestAccessAllowed());
    multiSelectOptions.showLabel(false);
    submit = new FormSubmit("subm", "submit");
    formLayout.add(submit);
}
Also used : FormSubmit(org.olat.core.gui.components.form.flexible.impl.elements.FormSubmit)

Example 4 with FormSubmit

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

the class WikiEditArticleForm method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    wikiContent = uifactory.addTextAreaElement("wikiContentElement", 20, 110, page.getContent(), formLayout);
    wikiContent.setElementCssClass("o_sel_wiki_content");
    wikiContent.setLabel(null, null);
    // OO-31 prevent trimming, so first line can be with inset (wiki pre-formatted)
    wikiContent.preventValueTrim(true);
    wikiContent.setFocus(true);
    updateComment = uifactory.addTextElement("wikiUpdateComment", null, 40, "", formLayout);
    updateComment.setExampleKey("update.comment", null);
    // Button layout
    final FormLayoutContainer buttonLayout = FormLayoutContainer.createButtonLayout("button_layout", getTranslator());
    formLayout.add(buttonLayout);
    FormSubmit submit = uifactory.addFormSubmitButton("save", buttonLayout);
    submit.setElementCssClass("o_sel_wiki_save");
    FormLink saveAndClose = uifactory.addFormLink("save.and.close", buttonLayout, Link.BUTTON);
    saveAndClose.setElementCssClass("o_sel_wiki_save_and_close");
    if (getIdentity().getKey().equals(Long.valueOf(page.getInitalAuthor())) || securityCallback.mayEditWikiMenu()) {
        uifactory.addFormLink("delete.page", buttonLayout, Link.BUTTON);
    }
    uifactory.addFormLink("preview", buttonLayout, Link.BUTTON);
    uifactory.addFormLink("media.upload", buttonLayout, Link.BUTTON);
    uifactory.addFormLink("manage.media", buttonLayout, Link.BUTTON);
    uifactory.addFormCancelButton("cancel", buttonLayout, ureq, getWindowControl());
}
Also used : FormSubmit(org.olat.core.gui.components.form.flexible.impl.elements.FormSubmit) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Example 5 with FormSubmit

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

the class AssessmentSectionExpertOptionsEditorController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    formLayout.setElementCssClass("o_sel_assessment_section_expert_options");
    setFormContextHelp("Test editor QTI 2.1 in detail#details_testeditor_section");
    if (!editable) {
        setFormWarning("warning.alien.assessment.test");
    }
    super.initForm(formLayout, listener, ureq);
    allowSkippingEl.setHelpUrlForManualPage("Test editor QTI 2.1 in detail#details_testeditor_section");
    allowCommentEl.setHelpUrlForManualPage("Test editor QTI 2.1 in detail#details_testeditor_section");
    allowReviewEl.setHelpUrlForManualPage("Test editor QTI 2.1 in detail#details_testeditor_section");
    showSolutionEl.setHelpUrlForManualPage("Test editor QTI 2.1 in detail#details_testeditor_section");
    // visible
    String[] yesnoValues = new String[] { translate("yes"), translate("no") };
    visibleEl = uifactory.addRadiosHorizontal("visible", "form.section.visible", formLayout, yesnoKeys, yesnoValues);
    visibleEl.setElementCssClass("o_sel_assessment_section_visible");
    visibleEl.setEnabled(!restrictedEdit && editable);
    if (section.getVisible()) {
        visibleEl.select("y", true);
    } else {
        visibleEl.select("n", true);
    }
    FormLayoutContainer buttonsCont = FormLayoutContainer.createButtonLayout("butons", getTranslator());
    formLayout.add(buttonsCont);
    FormSubmit submit = uifactory.addFormSubmitButton("save", "save", buttonsCont);
    submit.setEnabled(editable);
}
Also used : FormSubmit(org.olat.core.gui.components.form.flexible.impl.elements.FormSubmit) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)

Aggregations

FormSubmit (org.olat.core.gui.components.form.flexible.impl.elements.FormSubmit)42 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)16 HashSet (java.util.HashSet)4 StaticTextElement (org.olat.core.gui.components.form.flexible.elements.StaticTextElement)4 Submit (org.olat.core.gui.components.form.flexible.elements.Submit)4 VFSContainer (org.olat.core.util.vfs.VFSContainer)4 Date (java.util.Date)2 HashMap (java.util.HashMap)2 FormItem (org.olat.core.gui.components.form.flexible.FormItem)2 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)2 RichTextElement (org.olat.core.gui.components.form.flexible.elements.RichTextElement)2 Translator (org.olat.core.gui.translator.Translator)2 BusinessControlFactory (org.olat.core.id.context.BusinessControlFactory)2 ContextEntry (org.olat.core.id.context.ContextEntry)2 Checkbox (org.olat.course.nodes.cl.model.Checkbox)2 DBCheck (org.olat.course.nodes.cl.model.DBCheck)2 DBCheckbox (org.olat.course.nodes.cl.model.DBCheckbox)2 RubricBlock (uk.ac.ed.ph.jqtiplus.node.content.variable.RubricBlock)2 TimeLimits (uk.ac.ed.ph.jqtiplus.node.test.TimeLimits)2