Search in sources :

Example 21 with FormSubmit

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

the class SearchAdminForm method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    setFormTitle("search.admin.form.title");
    indexInterval = uifactory.addTextElement("indexInterval", "search.admin.label.index.interval", 20, "", formLayout);
    indexInterval.setRegexMatchCheck("\\d+", "error.index.interval.must.be.number");
    // indexInterval.setMinValueCheck(0, "error.index.interval.must.be.number");
    indexInterval.setDisplaySize(4);
    blackList = uifactory.addTextAreaElement("search.admin.label.blackList", 3, 80, "", formLayout);
    blackList.setExampleKey("search.admin.label.blackList.example", null);
    excelFileEnabled = uifactory.addCheckboxesHorizontal("search.admin.label.enableExcel", formLayout, new String[] { "on" }, new String[] { "" });
    pptFileEnabled = uifactory.addCheckboxesHorizontal("search.admin.label.enablePpt", formLayout, new String[] { "on" }, new String[] { "" });
    pdfFileEnabled = uifactory.addCheckboxesHorizontal("search.admin.label.enablePdf", formLayout, new String[] { "on" }, new String[] { "" });
    submit = new FormSubmit("submit", "submit");
    formLayout.add(submit);
}
Also used : FormSubmit(org.olat.core.gui.components.form.flexible.impl.elements.FormSubmit)

Example 22 with FormSubmit

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

the class GuiDemoFlexiFormHideUnhide 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) {
    setFormTitle("guidemo_flexi_form_hideunhide");
    final boolean inputMode = !personData.isReadOnly();
    /*
		 * hide unhide chooser
		 */
    checkbox = uifactory.addCheckboxesVertical("checkbox", "guidemo.flexi.form.show", formLayout, new String[] { "ison" }, new String[] { "" }, 1);
    checkbox.select("ison", true);
    // register for on click event to hide/disable other elements
    checkbox.addActionListener(FormEvent.ONCLICK);
    // rule to hide/unhide is defined at the end
    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("firstname", "guidemo.flexi.form.lastname", 256, personData.getLastName(), formLayout);
    lastName.setNotEmptyCheck("guidemo.flexi.form.mustbefilled");
    lastName.setMandatory(true);
    lastName.setEnabled(inputMode);
    institution = uifactory.addTextElement("institution", "guidemo.flexi.form.institution", 256, personData.getInstitution(), formLayout);
    institution.setEnabled(inputMode);
    if (inputMode) {
        // submit only if in input mode
        submit = new FormSubmit("submit", "submit");
        formLayout.add(submit);
    }
    /*
		 * now the rules to hide unhide 
		 */
    Set<FormItem> targets = new HashSet<FormItem>();
    targets.add(firstName);
    targets.add(lastName);
    targets.add(institution);
    targets.add(submit);
    RulesFactory.createHideRule(checkbox, null, targets, formLayout);
    RulesFactory.createShowRule(checkbox, "ison", targets, formLayout);
}
Also used : FormSubmit(org.olat.core.gui.components.form.flexible.impl.elements.FormSubmit) FormItem(org.olat.core.gui.components.form.flexible.FormItem) HashSet(java.util.HashSet)

Example 23 with FormSubmit

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

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 24 with FormSubmit

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

the class VCEditForm method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    editVC = FormLayoutContainer.createCustomFormLayout("titleLayout", getTranslator(), velocity_root + "/editForm.html");
    formLayout.add(editVC);
    // template chooser
    String[] keys = new String[templates.size() + 1];
    keys[0] = DefaultVCConfiguration.DEFAULT_TEMPLATE;
    String[] values = new String[templates.size() + 1];
    values[0] = "";
    int index = 1;
    for (String key : templates.keySet()) {
        keys[index] = key;
        values[index] = templates.get(key);
        index++;
    }
    boolean hasTemplates = templates.size() > 0;
    if (hasTemplates) {
        vcTemplate = uifactory.addDropdownSingleselect("vc.template.choose", "vc.template.choose.label", editVC, keys, values, null);
        String templateKey = config.getTemplateKey();
        vcTemplate.select(templateKey == null ? DefaultVCConfiguration.DEFAULT_TEMPLATE : templateKey, true);
    }
    editVC.contextPut("hasTemplates", hasTemplates);
    // meeting options
    boolean useDates = !dateList.isEmpty() | config.isUseMeetingDates();
    String[] accessKeys = new String[] { OPTION_DATES };
    String[] accessVals = new String[] { translate(OPTION_DATES) };
    multiSelectOptions = uifactory.addCheckboxesVertical("vc.options", "vc.options.label", editVC, accessKeys, accessVals, 1);
    multiSelectOptions.select(OPTION_DATES, useDates);
    multiSelectOptions.addActionListener(FormEvent.ONCHANGE);
    // create gui elements for all meetings
    editVC.contextPut("useDates", useDates);
    if (useDates)
        addDates();
    editVC.contextPut("dateList", dateList);
    editVC.contextPut("vcTitleInputList", vcTitleInputList);
    editVC.contextPut("vcDescriptionInputList", vcDescriptionInputList);
    editVC.contextPut("vcCalenderbeginInputList", vcCalenderbeginInputList);
    editVC.contextPut("vcDurationInputList", vcDurationInputList);
    editVC.contextPut("vcAddButtonList", vcAddButtonList);
    editVC.contextPut("vcDelButtonList", vcDelButtonList);
    submit = new FormSubmit("subm", "submit");
    formLayout.add(submit);
}
Also used : FormSubmit(org.olat.core.gui.components.form.flexible.impl.elements.FormSubmit)

Example 25 with FormSubmit

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

the class AdobeEditForm method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    // meeting options
    String[] accessKeys = new String[] { OPTION_OPEN_MEETING, OPTION_START_MEETING };
    String[] accessVals = new String[] { translate(OPTION_OPEN_MEETING), translate(OPTION_START_MEETING) };
    multiSelectOptions = uifactory.addCheckboxesVertical("vc.access", "vc.access.label", formLayout, accessKeys, accessVals, 1);
    multiSelectOptions.select(OPTION_START_MEETING, !config.isGuestStartMeetingAllowed());
    multiSelectOptions.select(OPTION_OPEN_MEETING, !config.isGuestAccessAllowed());
    multiSelectOptions.setVisible(showOptions);
    multiSelectOptions.addActionListener(FormEvent.ONCHANGE);
    multiSelectOptions.showLabel(false);
    submit = new FormSubmit("subm", "submit");
    formLayout.add(submit);
}
Also used : FormSubmit(org.olat.core.gui.components.form.flexible.impl.elements.FormSubmit)

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