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

If a portlet uses the liferay-ui:tabs tag, a JavaScript error is raised when adding the portlet to a page

    Details

      Description

      If a portlet uses the liferay-ui:tabs tag, a JavaScript error is raised when adding the portlet to a page. This error prevents the execution of any other JavaScript code from the portlet.

      If the page is reloaded, the problem does not happen again.

      Steps to reproduce

      1. Create a portlet with the following content in a JSP file:

      <%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %>
      <%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
      
      <liferay-ui:tabs names='<%= "1,2" %>' url="http://a.c" />
      <aui:script>
      alert("An alert from a portlet");
      </aui:script>
      

      2. Deploy the portlet.
      3. Logged in as an administrator, add the portlet to a page.
      4. Reload the page.

      Expected results

      • On step 3, an alert dialog would open with the message "An alert from a portlet")
      • On step 4, an alert dialog would open with the message "An alert from a portlet")

      Actual results:

      • On step 3, no alert is presented. Also, an error message appears in the browser console saying "Uncaught TypeError: Cannot call method 'contains' of null" (Google Chrome) or "TypeError: event.tabSection is null" (Firefox)
      • On step 4, an alert dialog would open with the message "An alert from a portlet") as expected

      A WAR of a portlet which reproduces the error is attached.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                pani.gui Pani Gui (Inactive)
                Reporter:
                adam.brandizzi Adam Brandizzi
                Participants of an Issue:
                Recent user:
                Esther Sanz
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  6 years, 14 weeks, 5 days ago

                  Packages

                  Version Package
                  6.2.0 CE B2