Uploaded image for project: 'PUBLIC - Liferay Faces'
  1. PUBLIC - Liferay Faces
  2. FACES-2549

alloy:outputScript target="body" is not rendered when used in a non-Liferay evironment

    Details

      Description

      {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}

        Attachments

          Activity

            People

            Assignee:
            kyle.stiemann Kyle Stiemann (Inactive)
            Reporter:
            kyle.stiemann Kyle Stiemann (Inactive)
            Participants of an Issue:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Packages

                Version Package
                alloy-2.0.0
                alloy-3.0.0