You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2010/04/27 16:59:43 UTC

svn commit: r938490 - /myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java

Author: lofwyr
Date: Tue Apr 27 14:59:43 2010
New Revision: 938490

URL: http://svn.apache.org/viewvc?rev=938490&view=rev
Log:
TOBAGO-877: Better support of typed literals in <tc:selectItem> and <f:selectItem>
 - fix for multiselects

Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java?rev=938490&r1=938489&r2=938490&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java Tue Apr 27 14:59:43 2010
@@ -46,6 +46,7 @@ import javax.faces.component.UIComponent
 import javax.faces.component.UIGraphic;
 import javax.faces.component.UIOutput;
 import javax.faces.component.UIParameter;
+import javax.faces.component.UISelectMany;
 import javax.faces.component.ValueHolder;
 import javax.faces.context.FacesContext;
 import javax.faces.convert.Converter;
@@ -743,7 +744,12 @@ public class ComponentUtils {
     try {
       Renderer renderer = getRenderer(facesContext, component);
       if (renderer != null) {
-        return renderer.getConvertedValue(facesContext, component, stringValue);
+        if (component instanceof UISelectMany) {
+          final Object converted = renderer.getConvertedValue(facesContext, component, new String[]{stringValue});
+          return ((Object[])converted)[0];
+        } else {
+          return renderer.getConvertedValue(facesContext, component, stringValue);
+        }
       } else {
         Converter converter = component.getConverter();
         if (converter == null) {