end-state bug fix

This commit is contained in:
Keith Donald
2008-07-13 04:41:06 +00:00
parent 15f0e40e38
commit 381e5e2091
12 changed files with 48 additions and 81 deletions

View File

@@ -97,26 +97,29 @@ public class JsfViewFactory implements ViewFactory {
UIViewRoot viewRoot = viewHandler.restoreView(facesContext, viewName);
if (viewRoot != null) {
if (logger.isDebugEnabled()) {
logger.debug("View root restored for '" + viewName + "'");
logger.debug("UIViewRoot restored for '" + viewName + "'");
}
facesContext.setViewRoot(viewRoot);
processTree(facesContext, viewRoot);
view = createJsfView(viewRoot, lifecycle, context);
facesContext.setViewRoot(view.getViewRoot());
processTree(facesContext, view.getViewRoot());
view.setRestored(true);
} else {
if (logger.isDebugEnabled()) {
logger.debug("Creating view root for '" + viewName + "'");
logger.debug("Creating UIViewRoot from '" + viewName + "'");
}
view = createJsfView(viewHandler.createView(facesContext, viewName), lifecycle, context);
facesContext.setViewRoot(view.getViewRoot());
viewRoot = viewHandler.createView(facesContext, viewName);
facesContext.setViewRoot(viewRoot);
view = createJsfView(viewRoot, lifecycle, context);
view.setRestored(false);
}
} else {
if (logger.isDebugEnabled()) {
logger.debug("Creating view root for '" + viewName + "'");
logger.debug("Creating transient UIViewRoot from '" + viewName + "'");
}
view = createJsfView(viewHandler.createView(facesContext, viewName), lifecycle, context);
facesContext.setViewRoot(view.getViewRoot());
UIViewRoot viewRoot = viewHandler.createView(facesContext, viewName);
viewRoot.setTransient(true);
facesContext.setViewRoot(viewRoot);
view = createJsfView(viewRoot, lifecycle, context);
view.setRestored(false);
}
}