-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: alloy-2.0.0, alloy-3.0.0
-
Fix Version/s: alloy-2.0.0, alloy-3.0.0
-
Component/s: Liferay Faces Alloy / Showcase / Tests
-
Labels:None
{markdown}
The Alloy OutputScriptRenderer attempts to render `alloy:outputScript target="body"` scripts at the bottom of the HTML page via `FacesRequestContext.addScript()`. However, since Util's BodyRenderer renders `FacesRequestContext` scripts *before* delegating to the JSF implementation's BodyRenderer (which is responsible for invoking the Alloy OutputScriptRenderer), the scripts get added too late.
So the script is never rendered because things happen in the following order:
1. Util's BodyRenderer calls `FacesRequestContext.getScripts()` but since Alloy OutputScriptRenderer hasn't been invoked yet, the returned list of scripts is empty.
2. Util's BodyRenderer calls `super.encodeEnd()` to call through to the wrapped BodyRenderer.
3. The wrapped BodyRenderer renders all resources with `target="body"`.
4. All `alloy:outputScript target="body"` tags are rendered.
5. Alloy OutputScriptRenderer calls `FacesRequestContext.addScript()` too late.
6. `FacesRequestContext` scripts never get rendererd.{markdown}
The Alloy OutputScriptRenderer attempts to render `alloy:outputScript target="body"` scripts at the bottom of the HTML page via `FacesRequestContext.addScript()`. However, since Util's BodyRenderer renders `FacesRequestContext` scripts *before* delegating to the JSF implementation's BodyRenderer (which is responsible for invoking the Alloy OutputScriptRenderer), the scripts get added too late.
So the script is never rendered because things happen in the following order:
1. Util's BodyRenderer calls `FacesRequestContext.getScripts()` but since Alloy OutputScriptRenderer hasn't been invoked yet, the returned list of scripts is empty.
2. Util's BodyRenderer calls `super.encodeEnd()` to call through to the wrapped BodyRenderer.
3. The wrapped BodyRenderer renders all resources with `target="body"`.
4. All `alloy:outputScript target="body"` tags are rendered.
5. Alloy OutputScriptRenderer calls `FacesRequestContext.addScript()` too late.
6. `FacesRequestContext` scripts never get rendererd.{markdown}