diff --git a/src/main/java/org/olat/core/gui/components/Window.java b/src/main/java/org/olat/core/gui/components/Window.java index c2d36083358702238c694958a7c3941d7720905a..dcdfae6b43c6c320538edf1f831a7ea685d8aa22 100644 --- a/src/main/java/org/olat/core/gui/components/Window.java +++ b/src/main/java/org/olat/core/gui/components/Window.java @@ -106,6 +106,12 @@ public class Window extends Container { */ public static final Event END_OF_DISPATCH_CYCLE = new Event("eodc"); + /** + * fired before render-only call is rendered (e.g. after reload, redirect). + * In this case normally no dispatch is fired. No dispatch will be done + */ + public static final Event BEFORE_RENDER_ONLY = new Event("before_render_only"); + /** * fired before inline (text/html computed response) takes place */ @@ -521,6 +527,7 @@ public class Window extends Container { if (renderOnly || timestampID == null) { inline = true; validate = true; + wbackofficeImpl.fireCycleEvent(BEFORE_RENDER_ONLY); } else if (validatingCausedRerendering && timestampID.equals("-1")) { // the first request after the 302 redirect cause by a component validation // -> just rerender, but clear the flag for further async media requests diff --git a/src/main/java/org/olat/course/nodes/scorm/ScormRunController.java b/src/main/java/org/olat/course/nodes/scorm/ScormRunController.java index 69c0df24e3c5e73280727a375f45efd762a75a3b..5fe242dd29b298d5d6ac6c05b6798a5ba56216dd 100644 --- a/src/main/java/org/olat/course/nodes/scorm/ScormRunController.java +++ b/src/main/java/org/olat/course/nodes/scorm/ScormRunController.java @@ -141,13 +141,9 @@ public class ScormRunController extends BasicController implements ScormAPICallb putInitialPanel(main); boolean doSkip = config.getBooleanSafe(ScormEditController.CONFIG_SKIPLAUNCHPAGE, true); - if (isAssessable && doSkip && !maxAttemptsReached()) { + if (doSkip && !maxAttemptsReached()) { doLaunch(ureq, true); - //CoordinatorManager.getInstance().getCoordinator().getEventBus().registerFor(this, ureq.getIdentity(), OresHelper.createOLATResourceableType(getClass().getName())); getWindowControl().getWindowBackOffice().addCycleListener(this); - -// Component scormContent = scormDispC.getInitialComponent(); -// fireEvent(ureq, new FullWidthReplaceRequestEvent(true, scormContent)); } } @@ -436,7 +432,12 @@ public class ScormRunController extends BasicController implements ScormAPICallb @Override public void event(Event event) { - if (event == Window.END_OF_DISPATCH_CYCLE) { + if (event == Window.END_OF_DISPATCH_CYCLE || event == Window.BEFORE_RENDER_ONLY) { + // do initial modal dialog activation + // a) just after the dispatching of the event which is before + // rendering after a normal click + // b) just before a render-only operation which happens when using a + // jump-in URL followed by a redirect without dispatching scormDispC.activate(); getWindowControl().getWindowBackOffice().removeCycleListener(this); }