myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r811563 - in /myfaces/core/trunk: api/src/main/java/javax/faces/component/ impl/src/main/java/org/apache/myfaces/el/unified/resolver/ impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/
Date Fri, 04 Sep 2009 21:45:18 GMT
Author: lu4242
Date: Fri Sep  4 21:45:17 2009
New Revision: 811563

URL: http://svn.apache.org/viewvc?rev=811563&view=rev
Log:
MYFACES-2340 Get "basic-ezcomp" 2.0 sample working ( comment fix on _ComponentAttributesMap
and change CompositeComponentRule way to set ValueExpressions for a composite component )

Modified:
    myfaces/core/trunk/api/src/main/java/javax/faces/component/_ComponentAttributesMap.java
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/CompositeComponentELResolver.java
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentRule.java

Modified: myfaces/core/trunk/api/src/main/java/javax/faces/component/_ComponentAttributesMap.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/component/_ComponentAttributesMap.java?rev=811563&r1=811562&r2=811563&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/component/_ComponentAttributesMap.java
(original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/component/_ComponentAttributesMap.java
Fri Sep  4 21:45:17 2009
@@ -244,16 +244,16 @@
                 ValueExpression ve = _component.getValueExpression((String) key);
                 if (ve != null)
                 {
-                    if (getUnderlyingMap().get ("org.apache.myfaces.COMPOSITE_COMPONENT_GET_VALUE_EXPRESSION")
!= null)
-                    {
+                    //if (getUnderlyingMap().get ("org.apache.myfaces.COMPOSITE_COMPONENT_GET_VALUE_EXPRESSION")
!= null)
+                    //{
                         // FIXME: this is "technically" a hack for the composite component
attribute
                         // EL resolver.  #{cc.attrs} is supposed to wrap this map and call
getValue()
                         // and setValue() on the ValueExpressions it returns... but the spec
says that
                         // this method always needs to evaluate ValueExpressions, and therefore
the EL
                         // resolver never even gets to see ValuExpressions.
                         
-                        return ve;
-                    }
+                    //    return ve;
+                    //}
                     
                     value = ve.getValue(FacesContext.getCurrentInstance().getELContext());
                 }

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/CompositeComponentELResolver.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/CompositeComponentELResolver.java?rev=811563&r1=811562&r2=811563&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/CompositeComponentELResolver.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/CompositeComponentELResolver.java
Fri Sep  4 21:45:17 2009
@@ -289,11 +289,11 @@
             // The presence of this attribute will tell the component attributes map not
to evaluate
             // ValueExpressions.
             
-            _originalMap.put (COMPOSITE_COMPONENT_GET_VALUE_EXPRESSION, Boolean.TRUE);
+            //_originalMap.put (COMPOSITE_COMPONENT_GET_VALUE_EXPRESSION, Boolean.TRUE);
             
             obj = _originalMap.get (key);
             
-            _originalMap.remove (COMPOSITE_COMPONENT_GET_VALUE_EXPRESSION);
+            //_originalMap.remove (COMPOSITE_COMPONENT_GET_VALUE_EXPRESSION);
             
             return obj;
         }

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentRule.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentRule.java?rev=811563&r1=811562&r2=811563&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentRule.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentRule.java
Fri Sep  4 21:45:17 2009
@@ -21,7 +21,6 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import javax.el.ValueExpression;
 import javax.faces.component.UIComponent;
 import javax.faces.view.facelets.FaceletContext;
 import javax.faces.view.facelets.MetaRule;
@@ -75,7 +74,14 @@
 
         public void applyMetadata(FaceletContext ctx, Object instance)
         {
-            ((UIComponent) instance).setValueExpression(_name, _attr.getValueExpression(ctx,
_type));
+            // Call setValueExpression to set ValueExpression instances
+            // cause problems later because when getAttributes().get() is called
+            // it is evaluated. put the ValueExpression directly on the map
+            // prevents it and does not cause any side effects.
+            // Maybe we should call setValueExpression when the getter and 
+            // setter exists on the component class.
+            ((UIComponent) instance).getAttributes().put(_name, _attr.getValueExpression(ctx,
_type));
+            //((UIComponent) instance).setValueExpression(_name, _attr.getValueExpression(ctx,
_type));
             //((UIComponent) instance).setValueExpression(_name, 
             //        ctx.getFacesContext().getApplication().
             //        getExpressionFactory().createValueExpression(



Mime
View raw message