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

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(); } }

Environment

None

Activity

Show:

Kyle StiemannAugust 7, 2018 at 2:59 PM

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Zendesk Support

Created August 7, 2018 at 1:44 PM
Updated November 1, 2019 at 1:37 PM
Resolved November 1, 2019 at 1:37 PM