Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-24172

Web Content Templates with RESOURCE_PHASE sections do not return anything

    Details

      Description

      I have a web content template that has a RENDER_PHASE which makes an AUI AJAX call to its RESOURCE_PHASE - but the RESOURCE_PHASE is never processed and never returns anything. Here is a simple template I use as a test:

      #set ($portletNamespace = $request.portlet-namespace)
      
      #if ($request.lifecycle == "RENDER_PHASE")
        <div id="${portletNamespace}map"><!-- --></div>
      
        <script type="text/javascript">
            AUI().use(
              "aui-base", "aui-io-plugin", "aui-io-request",
              function(A) {
                A.io.request(
                  "${request.resource-url}",
                  {
                    data: {
                    },
                    dataType: "json",
                    on: {
                      success: function(event, id, obj) {
                        var responseData = this.get("responseData");
                        document.getElementById("${portletNamespace}map").innerHTML = "<i>THE RESULT:</i> " + responseData;
                      }
                    }
                  }
                );
               }
              );
         </script>
      #elseif ($request.lifecycle == "RESOURCE_PHASE")
      
      <b>this is the resource phase result</b>
      
      #end
      

      The string "this is the resource phase result" is never seen (see screenshot)

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                7 years, 2 weeks, 2 days ago

                Packages

                Version Package
                6.1.0 CE RC1
                --Sprint 11/12
                6.2.0 CE M2