Search in sources :

Example 41 with FormSubmit

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

the class GuiDemoFlexiFormSubworkflow method initForm.

/**
 * @see org.olat.core.gui.components.form.flexible.impl.FormBasicController#initForm(org.olat.core.gui.components.form.flexible.FormItemContainer,
 *      org.olat.core.gui.control.Controller, org.olat.core.gui.UserRequest)
 */
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    /*
		 * create a form with a title and 4 input fields to enter some persons data
		 */
    // Example: set a form title and render within fieldsets
    setFormTitle("guidemo_flexi_form_withchooser");
    // Example2: Set a form description above the form
    setFormDescription("guidemo_flexi_form_withchooser.desc");
    // Example3: Set a context help link
    setFormContextHelp("Folders#Folders-MetaData");
    final boolean inputMode = !personData.isReadOnly();
    firstName = uifactory.addTextElement("firstname", "guidemo.flexi.form.firstname", 256, personData.getFirstName(), formLayout);
    firstName.setNotEmptyCheck("guidemo.flexi.form.mustbefilled");
    firstName.setMandatory(true);
    firstName.setEnabled(inputMode);
    lastName = uifactory.addTextElement("lastname", "guidemo.flexi.form.lastname", 256, personData.getLastName(), formLayout);
    lastName.setNotEmptyCheck("guidemo.flexi.form.mustbefilled");
    lastName.setMandatory(true);
    lastName.setEnabled(inputMode);
    /*
		 * - create a composite element
		 * - text element and to the left a choose link
		 * - the label of the textelement is set as the label of the layouting 
		 * container. 
		 */
    horizontalLayout = FormLayoutContainer.createHorizontalFormLayout("chooser", getTranslator());
    horizontalLayout.setLabel("guidemo.flexi.form.institution", null);
    formLayout.add(horizontalLayout);
    institution = uifactory.addTextElement("institution", null, 256, personData.getInstitution(), horizontalLayout);
    institution.setEnabled(false);
    choose = uifactory.addFormLink("choose", horizontalLayout);
    if (inputMode) {
        // submit only if in input mode
        submit = new FormSubmit("submit", "submit");
        formLayout.add(submit);
    }
}
Also used : FormSubmit(org.olat.core.gui.components.form.flexible.impl.elements.FormSubmit)

Example 42 with FormSubmit

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

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