You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by cr...@apache.org on 2005/08/30 21:31:26 UTC
svn commit: r264836 - in
/struts/shale/trunk/core-library/src/java/org/apache/shale:
dialog/faces/DialogNavigationHandler.java faces/ShaleViewHandler.java
Author: craigmcc
Date: Tue Aug 30 12:31:23 2005
New Revision: 264836
URL: http://svn.apache.org/viewcvs?rev=264836&view=rev
Log:
Clean up non-spec-compliant assumptions about whether the viewId property
of a created or restored UIViewRoot has been set (or not) by the underlying
ViewHandler that we are decorating.
PR: Bugzilla #36425, 36426
Submitted by: Sean Schofield <sean.schofield AT gmail.com>
Modified:
struts/shale/trunk/core-library/src/java/org/apache/shale/dialog/faces/DialogNavigationHandler.java
struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleViewHandler.java
Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/dialog/faces/DialogNavigationHandler.java
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/dialog/faces/DialogNavigationHandler.java?rev=264836&r1=264835&r2=264836&view=diff
==============================================================================
--- struts/shale/trunk/core-library/src/java/org/apache/shale/dialog/faces/DialogNavigationHandler.java (original)
+++ struts/shale/trunk/core-library/src/java/org/apache/shale/dialog/faces/DialogNavigationHandler.java Tue Aug 30 12:31:23 2005
@@ -404,6 +404,7 @@
// Create the specified view so that it can be rendered
ViewHandler vh = context.getApplication().getViewHandler();
UIViewRoot view = vh.createView(context, viewId);
+ view.setViewId(viewId);
context.setViewRoot(view);
}
Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleViewHandler.java
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleViewHandler.java?rev=264836&r1=264835&r2=264836&view=diff
==============================================================================
--- struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleViewHandler.java (original)
+++ struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleViewHandler.java Tue Aug 30 12:31:23 2005
@@ -119,7 +119,7 @@
*/
public UIViewRoot createView(FacesContext context, String viewId) {
UIViewRoot view = original.createView(context, viewId);
- setupViewController(context, view, false);
+ setupViewController(context, view, viewId, false);
return view;
}
@@ -153,7 +153,7 @@
*/
public UIViewRoot restoreView(FacesContext context, String viewId) {
UIViewRoot view = original.restoreView(context, viewId);
- setupViewController(context, view, true);
+ setupViewController(context, view, viewId, true);
return view;
}
@@ -192,17 +192,22 @@
* @param context <code>FacesContext</code> for the current request
* @param view <code>UIViewRoot</code> just created or restored
* (or <code>null</code> if there was no such view)
+ * @param view Id of the <code>UIViewRoot</code> just created or
+ * restored
* @param postBack <code>true</code> if this is a post back to
* an existing view
*/
private void setupViewController(FacesContext context, UIViewRoot view,
- boolean postBack) {
+ String viewId, boolean postBack) {
// Is there actually a view for us to procses?
if (view == null) {
return;
}
- String viewId = view.getViewId();
+
+ // Its not the responsibilty of createView method to set the viewId of the view
+ // (See JSF 1.1 spec. pg. 7-16)
+ //String viewId = view.getViewId();
if (log.isDebugEnabled()) {
log.debug("setupViewController(" + viewId + "," + postBack + ")");
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org