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 2015/04/01 00:01:52 UTC

svn commit: r1670492 - /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jstl/core/ForEachHandler.java

Author: lu4242
Date: Tue Mar 31 22:01:51 2015
New Revision: 1670492

URL: http://svn.apache.org/r1670492
Log:
MYFACES-3964 c:foreach not working when using custom equals or non serializable objects

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jstl/core/ForEachHandler.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jstl/core/ForEachHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jstl/core/ForEachHandler.java?rev=1670492&r1=1670491&r2=1670492&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jstl/core/ForEachHandler.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jstl/core/ForEachHandler.java Tue Mar 31 22:01:51 2015
@@ -43,7 +43,6 @@ import org.apache.myfaces.buildtools.mav
 import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFFaceletTag;
 import org.apache.myfaces.util.ExternalSpecifications;
 import org.apache.myfaces.view.facelets.AbstractFaceletContext;
-import org.apache.myfaces.view.facelets.ELExpressionCacheMode;
 import org.apache.myfaces.view.facelets.FaceletCompositionContext;
 import org.apache.myfaces.view.facelets.PageContext;
 import org.apache.myfaces.view.facelets.el.FaceletStateValueExpression;
@@ -265,16 +264,18 @@ public final class ForEachHandler extend
             {
                 ve = this.getVarExpr(srcVE, src, value, i);
             }
-            setVar(ctx, parent, uniqueId, base, v, ve);
+            setVar(ctx, parent, uniqueId, base, v, ve, srcVE);
         }
     }
     
     private void setVar(FaceletContext ctx, UIComponent parent,
-        String uniqueId, String base, String v, ValueExpression ve)
+        String uniqueId, String base, String v, ValueExpression ve, ValueExpression srcVE)
     {
         AbstractFaceletContext actx = ((AbstractFaceletContext) ctx);
         PageContext pctx = actx.getPageContext();
-        if (ELExpressionCacheMode.alwaysRecompile.equals(actx.getELExpressionCacheMode()))
+        //if (ELExpressionCacheMode.alwaysRecompile.equals(actx.getELExpressionCacheMode()))
+        //{
+        if (srcVE != null)
         {
             FaceletState faceletState = ComponentSupport.getFaceletState(ctx, parent, true);
             faceletState.putBinding(uniqueId, base, ve);
@@ -377,7 +378,7 @@ public final class ForEachHandler extend
                             {
                                 ve = new IterationStatusExpression(itrS);
                             }
-                            setVar(ctx, parent, uniqueId, base+"_vs", vs, ve);
+                            setVar(ctx, parent, uniqueId, base+"_vs", vs, ve, srcVE);
                         }
 
                         // execute body
@@ -470,7 +471,7 @@ public final class ForEachHandler extend
                         {
                             ve = new IterationStatusExpression(itrS);
                         }
-                        setVar(ctx, parent, uniqueId, base, vs, ve);
+                        setVar(ctx, parent, uniqueId, base, vs, ve, srcVE);
                     }
 
                     // execute body
@@ -594,7 +595,7 @@ public final class ForEachHandler extend
                             {
                                 ve = new IterationStatusExpression(itrS);
                             }
-                            setVar(ctx, parent, uniqueId, base, vs, ve);
+                            setVar(ctx, parent, uniqueId, base, vs, ve, srcVE);
                         }
                         //setVarStatus(ctx, pctx, t, sO, eO, mO, srcVE, value, vs, first, !itr.hasNext(), i);