This commit is contained in:
Keith Donald
2008-04-22 19:44:11 +00:00
parent 6c635c448a
commit 7495aac900
4 changed files with 6 additions and 0 deletions

View File

@@ -67,6 +67,8 @@ public class FlowActionListener implements ActionListener {
logger.debug("No action event detected");
context.getExternalContext().getRequestMap().remove(JsfView.EVENT_KEY);
}
// tells JSF lifecycle that rendering should now happen and any subsequent phases should be skipped
// required in the case of this action listener firing immediately (immediate=true) before validation
context.renderResponse();
}
}

View File

@@ -167,6 +167,7 @@ public class FlowFacesContext extends FacesContext {
}
public void renderResponse() {
// stored in flash scope to survive a redirect when transitioning from one view to another
context.getFlashScope().put(RENDER_RESPONSE_KEY, Boolean.TRUE);
}

View File

@@ -103,6 +103,7 @@ public class JsfView implements View {
try {
if (restored && !facesContext.getResponseComplete() && !facesContext.getRenderResponse()) {
facesLifecycle.execute(facesContext);
// TODO move this and renderResponse behavior into lifecycle
validateModel(facesContext);
}
} finally {

View File

@@ -68,6 +68,8 @@ public class JsfViewFactory implements ViewFactory {
FacesContext facesContext = FlowFacesContext.newInstance(context, lifecycle);
try {
if (!facesContext.getRenderResponse()) {
// only publish a RESTORE_VIEW event if this is the first phase of the lifecycle
// this won't be true when this method is called after a transition from one view-state to another
JsfUtils.notifyBeforeListeners(PhaseId.RESTORE_VIEW, lifecycle, facesContext);
}
ViewHandler viewHandler = facesContext.getApplication().getViewHandler();