myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r799993 - in /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf: ComponentTagHandlerDelegate.java ConverterTagHandlerDelegate.java ValidatorTagHandlerDelegate.java
Date Sun, 02 Aug 2009 05:07:22 GMT
Author: lu4242
Date: Sun Aug  2 05:07:21 2009
New Revision: 799993

URL: http://svn.apache.org/viewvc?rev=799993&view=rev
Log:
MYFACES-2300 binding property on facelets tag handlers should be retrieved from javax.faces.view.facelets.DelegatingMetaTagHandler
(and fix call for converterId and validatorId)

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ConverterTagHandlerDelegate.java
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ValidatorTagHandlerDelegate.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java?rev=799993&r1=799992&r2=799993&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java
Sun Aug  2 05:07:21 2009
@@ -56,8 +56,6 @@
     private final static Logger log = Logger.getLogger("facelets.tag.component");
 
     private final ComponentHandler _delegate;
-    
-    private final TagAttribute _binding;
 
     private final String _componentType;
 
@@ -72,7 +70,6 @@
         _componentType = delegateComponentConfig.getComponentType();
         _rendererType = delegateComponentConfig.getRendererType();
         _id = delegate.getTagAttribute("id");
-        _binding = delegate.getTagAttribute("binding");
     }
 
     /**
@@ -228,9 +225,9 @@
         UIComponent c = null;
         FacesContext faces = ctx.getFacesContext();
         Application app = faces.getApplication();
-        if (this._binding != null)
+        if (_delegate.getBinding() != null)
         {
-            ValueExpression ve = this._binding.getValueExpression(ctx, Object.class);
+            ValueExpression ve = _delegate.getBinding().getValueExpression(ctx, Object.class);
             
             c = app.createComponent(ve, faces, this._componentType);
             if (c != null)

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ConverterTagHandlerDelegate.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ConverterTagHandlerDelegate.java?rev=799993&r1=799992&r2=799993&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ConverterTagHandlerDelegate.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ConverterTagHandlerDelegate.java
Sun Aug  2 05:07:21 2009
@@ -50,25 +50,9 @@
 {
     private ConverterHandler _delegate;
     
-    private final TagAttribute _binding;
-
-    private String _converterId;
-
     public ConverterTagHandlerDelegate(ConverterHandler delegate)
     {
         _delegate = delegate;
-
-        //TODO: Is this the way?
-        if (_delegate.getConverterId(null) != null)
-        {
-            this._binding = null;
-            this._converterId = _delegate.getConverterId(null);
-        }
-        else
-        {
-            this._binding = delegate.getTagAttribute("binding");
-            this._converterId = null;
-        }
     }
 
     /**
@@ -102,9 +86,9 @@
             ValueHolder vh = (ValueHolder) parent;
             ValueExpression ve = null;
             Converter c = null;
-            if (this._binding != null)
+            if (_delegate.getBinding() != null)
             {
-                ve = this._binding.getValueExpression(ctx, Converter.class);
+                ve = _delegate.getBinding().getValueExpression(ctx, Converter.class);
                 c = (Converter) ve.getValue(ctx);
             }
             if (c == null)
@@ -139,13 +123,13 @@
      */
     protected Converter createConverter(FaceletContext ctx)
     {
-        if (this._converterId == null)
+        if (_delegate.getConverterId(ctx) == null)
         {
             throw new TagException(
                                    _delegate.getTag(),
                                    "Default behavior invoked of requiring a converter-id
passed in the constructor, must override ConvertHandler(ConverterConfig)");
         }
-        return ctx.getFacesContext().getApplication().createConverter(this._converterId);
+        return ctx.getFacesContext().getApplication().createConverter(_delegate.getConverterId(ctx));
     }
 
     @Override

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ValidatorTagHandlerDelegate.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ValidatorTagHandlerDelegate.java?rev=799993&r1=799992&r2=799993&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ValidatorTagHandlerDelegate.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ValidatorTagHandlerDelegate.java
Sun Aug  2 05:07:21 2009
@@ -50,25 +50,9 @@
 {
     private ValidatorHandler _delegate;
     
-    private final TagAttribute _binding;
-    
-    private String _validatorId;
-    
     public ValidatorTagHandlerDelegate(ValidatorHandler delegate)
     {
         _delegate = delegate;
-
-        //TODO: Is this the way?
-        if (_delegate.getValidatorConfig().getValidatorId() != null)
-        {
-            this._binding = null;
-            this._validatorId = _delegate.getValidatorConfig().getValidatorId();
-        }
-        else
-        {
-            this._binding = delegate.getTagAttribute("binding");
-            this._validatorId = null;
-        }
     }
 
     @Override
@@ -87,9 +71,9 @@
             EditableValueHolder evh = (EditableValueHolder) parent;
             ValueExpression ve = null;
             Validator v = null;
-            if (this._binding != null)
+            if (_delegate.getBinding() != null)
             {
-                ve = this._binding.getValueExpression(ctx, Validator.class);
+                ve = _delegate.getBinding().getValueExpression(ctx, Validator.class);
                 v = (Validator) ve.getValue(ctx);
             }
             if (v == null)
@@ -118,13 +102,13 @@
      */
     protected Validator createValidator(FaceletContext ctx)
     {
-        if (this._validatorId == null)
+        if (_delegate.getValidatorId(ctx) == null)
         {
             throw new TagException(
                                    _delegate.getTag(),
                                    "Default behavior invoked of requiring a validator-id
passed in the constructor, must override ValidateHandler(ValidatorConfig)");
         }
-        return ctx.getFacesContext().getApplication().createValidator(this._validatorId);
+        return ctx.getFacesContext().getApplication().createValidator(_delegate.getValidatorId(ctx));
     }
 
     @Override



Mime
View raw message