use of org.olat.core.gui.components.form.flexible.impl.FormEvent in project OpenOLAT by OpenOLAT.
the class FormToggleImpl method dispatchFormRequest.
@Override
public void dispatchFormRequest(UserRequest ureq) {
toggle();
getRootForm().fireFormEvent(ureq, new FormEvent(Event.DONE_EVENT, this, FormEvent.ONCLICK));
}
use of org.olat.core.gui.components.form.flexible.impl.FormEvent in project OpenOLAT by OpenOLAT.
the class ResumeController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (source.equals(noButton)) {
savePreferences(ureq, "none");
fireEvent(ureq, new Event("no"));
} else if (source.equals(landingButton)) {
savePreferences(ureq, "none");
fireEvent(ureq, new Event("landing"));
}
}
use of org.olat.core.gui.components.form.flexible.impl.FormEvent in project openolat by klemens.
the class CheckboxEditController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (deleteLink == source) {
fireEvent(ureq, new Event("delete"));
if (courseNode != null) {
ThreadLocalUserActivityLogger.log(CourseLoggingAction.CHECKLIST_CHECKBOX_DELETED, getClass(), LoggingResourceable.wrap(courseNode), LoggingResourceable.wrapNonOlatResource(StringResourceableType.checkbox, checkbox.getCheckboxId(), checkbox.getTitle()));
}
} else if (downloadFileLink == source) {
doDownloadFile(ureq);
} else if (deleteFileLink == source) {
deleteFile();
} else if (awardPointEl == source) {
pointsEl.setVisible(withScore && awardPointEl.isAtLeastSelected(1));
} else if (fileEl == source) {
String filename = fileEl.getUploadFileName();
downloadFileLink.setI18nKey(filename);
downloadFileLink.setEnabled(false);
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.core.gui.components.form.flexible.impl.FormEvent in project openolat by klemens.
the class RichTextElementComponent method doDispatchRequest.
@Override
protected void doDispatchRequest(UserRequest ureq) {
// SPECIAL CASE - normally this method is never overriden. For the rich text
// element we make an exception since we have the media and link chooser
// events that must be dispatched by this code.
String moduleUri = ureq.getModuleURI();
if (CMD_FILEBROWSER.equals(moduleUri) || CMD_IMAGEBROWSER.equals(moduleUri) || CMD_FLASHPLAYERBROWSER.equals(moduleUri) || CMD_MEDIABROWSER.equals(moduleUri)) {
// Get currently edited relative file path
String fileName = getRichTextElementImpl().getEditorConfiguration().getLinkBrowserRelativeFilePath();
createFileSelectorPopupWindow(ureq, moduleUri, fileName);
setDirty(false);
} else {
String cmd = ureq.getParameter("cmd");
if (StringHelper.containsNonWhitespace(cmd)) {
element.getRootForm().fireFormEvent(ureq, new FormEvent(cmd, element, FormEvent.ONCLICK));
}
setDirty(false);
}
}
use of org.olat.core.gui.components.form.flexible.impl.FormEvent in project openolat by klemens.
the class RichTextElementImpl method evalFormRequest.
/**
* @see org.olat.core.gui.components.form.flexible.FormItemImpl#evalFormRequest(org.olat.core.gui.UserRequest)
*/
@Override
public void evalFormRequest(UserRequest ureq) {
String paramId = component.getFormDispatchId();
String cmd = getRootForm().getRequestParameter("cmd");
String submitValue = getRootForm().getRequestParameter(paramId);
if (StringHelper.containsNonWhitespace(submitValue)) {
if (renderingMode == TextMode.oneLine) {
submitValue = TextMode.fromOneLine(submitValue);
} else if (renderingMode == TextMode.multiLine) {
submitValue = TextMode.fromMultiLine(submitValue);
}
}
String dispatchUri = getRootForm().getRequestParameter("dispatchuri");
if ("saveinlinedtiny".equals(cmd)) {
if (submitValue != null) {
setValue(submitValue);
getRootForm().fireFormEvent(ureq, new FormEvent(cmd, this, FormEvent.ONCLICK));
}
} else if (submitValue != null) {
setValue(submitValue);
// don't re-render component, value in GUI already correct
component.setDirty(false);
} else if (cmd != null && !cmd.equals("multiline") && !cmd.equals("formatted")) {
getRootForm().fireFormEvent(ureq, new FormEvent(cmd, this, FormEvent.ONCLICK));
component.setDirty(false);
}
if (paramId.equals(dispatchUri)) {
if (TextMode.formatted.name().equals(cmd)) {
component.setCurrentTextMode(TextMode.formatted);
} else if (TextMode.multiLine.name().equals(cmd)) {
component.setCurrentTextMode(TextMode.multiLine);
} else if (TextMode.oneLine.name().equals(cmd)) {
component.setCurrentTextMode(TextMode.oneLine);
}
}
}
Aggregations