myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r905502 - /myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java
Date Tue, 02 Feb 2010 03:37:52 GMT
Author: lu4242
Date: Tue Feb  2 03:37:46 2010
New Revision: 905502

URL: http://svn.apache.org/viewvc?rev=905502&view=rev
Log:
MYFACES-2483 Find a way to allow c:if work with partial state saving enabled

Modified:
    myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java

Modified: myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java?rev=905502&r1=905501&r2=905502&view=diff
==============================================================================
--- myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java
(original)
+++ myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java
Tue Feb  2 03:37:46 2010
@@ -175,9 +175,24 @@
     @JSFWebConfigParam(since="1.2.7")
     private static final String INIT_PARAM_DELEGATE_FACES_SERVLET = "org.apache.myfaces.DELEGATE_FACES_SERVLET";
 
+    /**
+     * This param is only valid when partial state saving is on.
+     * If this is set as true, the tag-handlers are reapplied like in facelets 1.1.x, allowing
+     * c:if work correctly to "toggle" components based on a value changed on invoke application
phase. 
+     */
     @JSFWebConfigParam(since="2.0")
     public final static String INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS = "org.apache.myfaces.REFRESH_TRANSIENT_BUILD_ON_PSS";

     public final static String INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_DEFAULT = "false";
+
+    /**
+     * This param is only valid when partial state saving is on.
+     * If this is set as true, parent components containing  c:if, c:forEach, 
+     * c:choose and ui:insert with src=ELExpression are marked to be restored fully, so state
+     * is preserved between request.
+     */
+    @JSFWebConfigParam(since="2.0")
+    public final static String INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE =
"org.apache.myfaces.REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE";
+    public final static boolean INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE_DEFAULT
= false;
     
     private boolean _prettyHtml;
     private boolean _detectJavascript;
@@ -196,6 +211,7 @@
     private String _delegateFacesServlet;
     private boolean _refreshTransientBuildOnPSS;
     private boolean _refreshTransientBuildOnPSSAuto;
+    private boolean refreshTransientBuildOnPSSPreserveState;
 
     private static final boolean TOMAHAWK_AVAILABLE;
     private static final boolean MYFACES_IMPL_AVAILABLE;
@@ -317,6 +333,10 @@
             myfacesConfig.setRefreshTransientBuildOnPSS(false);
             myfacesConfig.setRefreshTransientBuildOnPSSAuto(false);
         }
+        
+        myfacesConfig.setRefreshTransientBuildOnPSSPreserveState(getBooleanInitParameter(extCtx,
+                INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE, 
+                INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE_DEFAULT));
 
         if (TOMAHAWK_AVAILABLE)
         {
@@ -668,4 +688,15 @@
     {
         this._refreshTransientBuildOnPSSAuto = refreshTransientBuildOnPSSAuto;
     }
+
+    public boolean isRefreshTransientBuildOnPSSPreserveState()
+    {
+        return refreshTransientBuildOnPSSPreserveState;
+    }
+
+    public void setRefreshTransientBuildOnPSSPreserveState(
+            boolean refreshTransientBuildOnPSSPreserveState)
+    {
+        this.refreshTransientBuildOnPSSPreserveState = refreshTransientBuildOnPSSPreserveState;
+    }
 }



Mime
View raw message