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

PrimeFaces exporter components (p:fileDownload, p:dataExporter, and pe:exporter) cause next navigation to fail

    Details

      Description

      Steps to reproduce:

      1. Add the following button to the PrimeFaces applicant portlet's applicant.xhtml:
         <h:button outcome="/WEB-INF/views/portletEditMode.xhtml"
            value="/WEB-INF/views/portletEditMode.xhtml" />
        
      2. Deploy and navigate to the portlet.
      3. Click the /WEB-INF/views/portletEditMode.xhtml button.
      4. Confirm that edit mode is shown with Date Format input and Submit and Reset buttons.
      5. Use the back button to return to the original view.
      6. Hard reload (clear cache).
      7. Click the Export as CSV button and confirm any download dialogs.
      8. Click the /WEB-INF/views/portletEditMode.xhtml button.

      If the bug still exists, the applicant.xhtml markup will appear without PrimeFaces CSS styling.

      If the bug is fixed, edit mode will be shown with Date Format input and Submit and Reset buttons.

      Potential Workaround

      Add an actionListener after p:fileDownload, p:dataExporter, or pe:exporter that releases the FacesContext after the download completes:

      <p:commandButton value="Download" ajax="false">
          <p:fileDownload value="#{bean.file}" />
          <f:actionListener type="my.package.name.ReleaseFacesContext" />
      </p:commandButton>
      

      ReleaseFacesContext:

      public final class ReleaseFacesContext implements ActionListener {
      
          @Override
          public void processAction(ActionEvent actionEvent)
              throws AbortProcessingException {
              FacesContext.getCurrentInstance().release();
          }
      }
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: