You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2009/12/18 03:17:16 UTC

svn commit: r892110 - /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java

Author: lu4242
Date: Fri Dec 18 02:17:10 2009
New Revision: 892110

URL: http://svn.apache.org/viewvc?rev=892110&view=rev
Log:
move all init code of StateManagementStrategy to getStateManagementStrategy, to allow easy wrapping

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java?rev=892110&r1=892109&r2=892110&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java Fri Dec 18 02:17:10 2009
@@ -202,7 +202,7 @@
 
     private FaceletFactory _faceletFactory;
 
-    private StateManagementStrategy stateMgmtStrategy;
+    private StateManagementStrategy _stateMgmtStrategy;
     
     private boolean _partialStateSaving;
     
@@ -278,7 +278,7 @@
             // relocated components are not retrieved later on getClientIdsRemoved().
             if (!(context.isPostback() && PhaseId.RESTORE_VIEW.equals(context.getCurrentPhaseId())))
             {
-                ((DefaultFaceletsStateManagementStrategy) stateMgmtStrategy).suscribeListeners(view);
+                ((DefaultFaceletsStateManagementStrategy) getStateManagementStrategy(context, view.getViewId())).suscribeListeners(view);
             }
         }
     }
@@ -789,7 +789,12 @@
     {
         // Use partial state saving strategy only if javax.faces.PARTIAL_STATE_SAVING is "true" and
         // the current view is not on javax.faces.FULL_STATE_SAVING_VIEW_IDS.
-        return _usePartialStateSavingOnThisView(viewId) ? stateMgmtStrategy : null;
+        if (_partialStateSaving && _stateMgmtStrategy == null)
+        {
+            _stateMgmtStrategy = new DefaultFaceletsStateManagementStrategy(this);
+        }
+        
+        return _usePartialStateSavingOnThisView(viewId) ? _stateMgmtStrategy : null;
     }
 
     /**
@@ -1300,11 +1305,6 @@
         _initializeBuffer(eContext);
         _initializeMode(eContext);
 
-        if (_partialStateSaving)
-        {
-            stateMgmtStrategy = new DefaultFaceletsStateManagementStrategy(this);
-        }
-        
         log.finest("Initialization Successful");
     }