You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2006/10/17 00:40:51 UTC

svn commit: r464701 - /myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ConverterTag.java

Author: bommel
Date: Mon Oct 16 15:40:47 2006
New Revision: 464701

URL: http://svn.apache.org/viewvc?view=rev&rev=464701
Log:
TOBAGO-156

Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ConverterTag.java

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ConverterTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ConverterTag.java?view=diff&rev=464701&r1=464700&r2=464701
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ConverterTag.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ConverterTag.java Mon Oct 16 15:40:47 2006
@@ -20,6 +20,7 @@
 import org.apache.myfaces.tobago.apt.annotation.BodyContent;
 import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
 import org.apache.myfaces.tobago.component.ComponentUtil;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_CONVERTER;
 
 import javax.servlet.jsp.tagext.TagSupport;
 import javax.servlet.jsp.JspException;
@@ -53,7 +54,7 @@
    * The converterId of a registered Converter.
    * @param converterId  A valid converterId
    */
-  @TagAttribute(required = true)
+  @TagAttribute()
   public void setConverterId(String converterId) {
     this.converterId = converterId;
   }
@@ -130,7 +131,11 @@
       }
     }
     if (converter != null) {
-      valueHolder.setConverter(converter);
+      if (UIComponentTag.isValueReference(binding)) {
+        component.setValueBinding(ATTR_CONVERTER, ComponentUtil.createValueBinding(binding));
+      } else {
+        valueHolder.setConverter(converter);
+      }
     }
     // TODO else LOG.warn?
     return (SKIP_BODY);



Re: svn commit: r464701 - /myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ConverterTag.java

Posted by Volker Weber <we...@googlemail.com>.
Bernd please add a short description additionaly to the jira id.

Regards
  Volker

2006/10/17, bommel@apache.org <bo...@apache.org>:
> Author: bommel
> Date: Mon Oct 16 15:40:47 2006
> New Revision: 464701
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=464701
> Log:
> TOBAGO-156
>
> Modified:
>     myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ConverterTag.java
>
> Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ConverterTag.java
> URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ConverterTag.java?view=diff&rev=464701&r1=464700&r2=464701
> ==============================================================================
> --- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ConverterTag.java (original)
> +++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ConverterTag.java Mon Oct 16 15:40:47 2006
> @@ -20,6 +20,7 @@
>  import org.apache.myfaces.tobago.apt.annotation.BodyContent;
>  import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
>  import org.apache.myfaces.tobago.component.ComponentUtil;
> +import static org.apache.myfaces.tobago.TobagoConstants.ATTR_CONVERTER;
>
>  import javax.servlet.jsp.tagext.TagSupport;
>  import javax.servlet.jsp.JspException;
> @@ -53,7 +54,7 @@
>     * The converterId of a registered Converter.
>     * @param converterId  A valid converterId
>     */
> -  @TagAttribute(required = true)
> +  @TagAttribute()
>    public void setConverterId(String converterId) {
>      this.converterId = converterId;
>    }
> @@ -130,7 +131,11 @@
>        }
>      }
>      if (converter != null) {
> -      valueHolder.setConverter(converter);
> +      if (UIComponentTag.isValueReference(binding)) {
> +        component.setValueBinding(ATTR_CONVERTER, ComponentUtil.createValueBinding(binding));
> +      } else {
> +        valueHolder.setConverter(converter);
> +      }
>      }
>      // TODO else LOG.warn?
>      return (SKIP_BODY);
>
>
>