@Override protected void formInnerEvent( final UserRequest ureq, final FormItem source, final FormEvent event) { if (config == null) { throw new AssertException("Try to do updateConfiguration() but module configuration is null"); } config.set( DialogConfigForm.DIALOG_CONFIG_INTEGRATION, select.isSelected(0) ? CONFIG_INTEGRATION_VALUE_POPUP : CONFIG_INTEGRATION_VALUE_INLINE); config.setConfigurationVersion(1); fireEvent(ureq, Event.CHANGED_EVENT); }
@Override protected void initForm( final FormItemContainer formLayout, final Controller listener, final UserRequest ureq) { if (config == null) { throw new AssertException("module configuration is null!"); } select = uifactory.addCheckboxesVertical( "forumAsPopup", "selection.forumAsPopup.label", formLayout, new String[] {"xx"}, new String[] {null}, null, 1); final String selectConfig = (String) config.get(DialogConfigForm.DIALOG_CONFIG_INTEGRATION); select.select("xx", selectConfig == CONFIG_INTEGRATION_VALUE_POPUP); select.addActionListener(this, FormEvent.ONCLICK); }
@Override protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) { setFormTitle("fieldset.dropbox.title"); setFormContextHelp("Other#bb_themenvergabe_abgabe"); String sConfirmation = (String) config.get(TACourseNode.CONF_DROPBOX_CONFIRMATION); if (sConfirmation == null || sConfirmation.length() == 0) { // grab standard text sConfirmation = translate("conf.stdtext"); config.set(TACourseNode.CONF_DROPBOX_CONFIRMATION, sConfirmation); } confirmation = uifactory.addTextAreaElement( "confirmation", "form.dropbox.confirmation", 2500, 4, 40, true, sConfirmation != null ? sConfirmation : "", formLayout); Boolean enableMail = (Boolean) config.get(TACourseNode.CONF_DROPBOX_ENABLEMAIL); confirmation.setMandatory(enableMail); enablemail = uifactory.addCheckboxesHorizontal( "enablemail", "form.dropbox.enablemail", formLayout, new String[] {"xx"}, new String[] {null}); enablemail.select("xx", enableMail != null ? enableMail.booleanValue() : true); enablemail.addActionListener(FormEvent.ONCLICK); uifactory.addFormSubmitButton("submit", formLayout); }
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) { if (source == enablemail) { confirmation.setMandatory(enablemail.isSelected(0)); validateFormLogic(ureq); } }
/** @return mailEnabled field value */ public boolean mailEnabled() { return enablemail.isSelected(0); }