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

Primefaces state list items appear after SPA navigation to and from primefaces-applicant-portlet on Liferay 7.0

    Details

      Description

      Steps to reproduce:

      1. Deploy the primefaces-applicant-portlet and test-setup-hook to Liferay 7.0. Make sure that you do not have the richfaces-applicant-portlet deployed (because we need an empty page).
      2. Navigate to the empty richfaces-applicant-portlet page.
      3. Click on the primefaces-applicant link.
      4. Click on the richfaces-applicant link.

      If the bug still exists, then the following will appear on the empty page:

      • FL
      • MD
      • NC
      • NJ
      • NY
      • SC
      • VA

      I believe this issue is due to the fact that Primefaces attaches hidden elements to the <body> so that they can be shown or modified via JavaScript. The parent <div> has the class ui-helper-hidden suggesting that the element should be hidden. However, the Primefaces CSS has been unloaded by SennaJS, so the element is no longer hidden.

      This issue has a few potential solutions:

      • Use p:selectOneMenu appendTo attribute to ensure that the elements rendered by p:selectOneMenu are appended to an element within the portlet's <div> instead of the <body> tag so that these elements are automatically removed during SennaJS SPA navigation (along with the rest of the portlet). Possible solutions include appendTo="@this", appendTo="@root" or appendTo="@id(#{portletNamespace})" (for the ViewRoot), or appendTo="@form". See this comment for more details.
      • One workaround and solution would be to add a small CSS file which makes those ui-helper-hidden elements and other hidden elements display: none;. This resource would need to include data-senna-track="permanent" as an attribute in order to remain loaded after a user navigates away from a Primefaces portlet.
      • Another solution would be to add data-senna-track="permanent" to all Primefaces CSS so it would keep the element(s) hidden even when users navigate away from a Primefaces portlet. The drawback to both of these solutions is that file won't be unloaded as long as the user navigates via SPA.
      • Another solution would be to remove all JSF elements from the <body> element on SPA navigation away from the portlet. Since JSF elements always include the portlet namespace in their id, they should be easy to find and remove. However, this would require hooking into the SPA lifecycle with another JS file. It would also require a lot of research into SPA.

        Attachments

          Issue Links

            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
                  bridge-impl-4.1.0