@Override
    public void beforePhase(PhaseEvent event) {
        if (isInDialogPreparation()) {
            Flash flash = FacesContext.getCurrentInstance().getExternalContext().getFlash();
            for (String flashName : flash.keySet()) {
                flash.keep(flashName);
            }
        }
    }
Keeps objects within Flash during opening a Dialog Framework - dialog and so allows passing objects via Flash to a Dialog Framework - dialog.
primefaces/src/main/java/org/primefaces/application/DialogKeepFlashPhaseListener.java