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);
}
}
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);
}
Aggregations