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 2012/04/24 13:23:27 UTC

svn commit: r1329643 - in /myfaces/tobago/trunk: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/ tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ tobago-core/src/main/java/org/apache/myfaces/tobago/...

Author: lofwyr
Date: Tue Apr 24 11:23:26 2012
New Revision: 1329643

URL: http://svn.apache.org/viewvc?rev=1329643&view=rev
Log:
TOBAGO-1108: tx:selectManyListbox doesn't accept List-Objects as value

Added:
    myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/SelectManyListboxBean.java
    myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/selectManyListbox/selectManyListbox-value.xhtml
      - copied, changed from r1328229, myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/selectManyListbox/selectManyListbox.xhtml
Modified:
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISelectMany.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SelectManyCheckboxTagDeclaration.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SelectManyListboxTagDeclaration.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SelectManyShuttleTagDeclaration.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java
    myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml
    myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/CreateComponentAnnotationVisitor.java

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISelectMany.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISelectMany.java?rev=1329643&r1=1329642&r2=1329643&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISelectMany.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISelectMany.java Tue Apr 24 11:23:26 2012
@@ -22,7 +22,16 @@ import org.apache.myfaces.tobago.compone
 import org.apache.myfaces.tobago.layout.LayoutComponent;
 
 import javax.faces.component.UISelectMany;
+import java.util.Collection;
 
 public abstract class AbstractUISelectMany extends UISelectMany implements SupportsMarkup, LayoutComponent {
 
+  public Object[] getSelectedValues() {
+    Object value = getValue();
+    if (value instanceof Collection) {
+      return ((Collection) value).toArray();
+    } else {
+      return (Object[]) value;
+    }
+  }
 }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SelectManyCheckboxTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SelectManyCheckboxTagDeclaration.java?rev=1329643&r1=1329642&r2=1329643&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SelectManyCheckboxTagDeclaration.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SelectManyCheckboxTagDeclaration.java Tue Apr 24 11:23:26 2012
@@ -19,18 +19,28 @@ package org.apache.myfaces.tobago.intern
 
 import org.apache.myfaces.tobago.apt.annotation.BodyContentDescription;
 import org.apache.myfaces.tobago.apt.annotation.Tag;
+import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
 import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
 import org.apache.myfaces.tobago.component.RendererTypes;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasBinding;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasConverter;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasConverterMessage;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasCurrentMarkup;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasId;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasInputLabel;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasMarkup;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasOnchange;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasRenderRange;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasRequiredMessage;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasTabIndex;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasTip;
-import org.apache.myfaces.tobago.internal.taglib.declaration.InputTagDeclaration;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasValidator;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasValidatorMessage;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasValueChangeListener;
 import org.apache.myfaces.tobago.internal.taglib.declaration.IsDisabled;
+import org.apache.myfaces.tobago.internal.taglib.declaration.IsFocus;
+import org.apache.myfaces.tobago.internal.taglib.declaration.IsGridLayoutComponent;
 import org.apache.myfaces.tobago.internal.taglib.declaration.IsInline;
 import org.apache.myfaces.tobago.internal.taglib.declaration.IsReadonly;
 import org.apache.myfaces.tobago.internal.taglib.declaration.IsRendered;
@@ -49,8 +59,15 @@ import org.apache.myfaces.tobago.interna
         "javax.faces.SelectItem",
         "javax.faces.SelectItems"})
 public interface SelectManyCheckboxTagDeclaration extends
-    IsDisabled, HasId, HasTip,
-    IsInline, HasRenderRange, IsRendered, IsRequired, HasBinding, IsReadonly, HasConverter,
-    InputTagDeclaration, HasMarkup, HasCurrentMarkup, HasInputLabel {
+    IsDisabled, HasId, HasTip, IsInline, HasRenderRange, IsRendered, IsRequired, HasBinding, IsReadonly, HasConverter,
+    HasMarkup, HasCurrentMarkup, HasInputLabel, HasValidator, HasOnchange, HasValueChangeListener,
+    HasValidatorMessage, HasConverterMessage, HasRequiredMessage, HasTabIndex, IsFocus, IsGridLayoutComponent {
+
+  /**
+   * The value of the multi select.
+   */
+  @TagAttribute
+  @UIComponentTagAttribute(type = {"java.lang.Object[]", "java.util.List"})
+  void setValue(String value);
 
 }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SelectManyListboxTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SelectManyListboxTagDeclaration.java?rev=1329643&r1=1329642&r2=1329643&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SelectManyListboxTagDeclaration.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SelectManyListboxTagDeclaration.java Tue Apr 24 11:23:26 2012
@@ -18,18 +18,28 @@ package org.apache.myfaces.tobago.intern
  */
 
 import org.apache.myfaces.tobago.apt.annotation.Tag;
+import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
 import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
 import org.apache.myfaces.tobago.component.RendererTypes;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasBinding;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasConverter;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasConverterMessage;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasCurrentMarkup;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasId;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasLabelAndAccessKey;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasMarkup;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasOnchange;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasRequiredMessage;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasTabIndex;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasTip;
-import org.apache.myfaces.tobago.internal.taglib.declaration.InputTagDeclaration;
-import org.apache.myfaces.tobago.internal.taglib.declaration.IsDisabled;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasValidator;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasValidatorMessage;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasValueChangeListener;
 import org.apache.myfaces.tobago.internal.taglib.declaration.IsDeprecatedInline;
+import org.apache.myfaces.tobago.internal.taglib.declaration.IsDisabled;
+import org.apache.myfaces.tobago.internal.taglib.declaration.IsFocus;
+import org.apache.myfaces.tobago.internal.taglib.declaration.IsGridLayoutComponent;
 import org.apache.myfaces.tobago.internal.taglib.declaration.IsReadonly;
 import org.apache.myfaces.tobago.internal.taglib.declaration.IsRendered;
 import org.apache.myfaces.tobago.internal.taglib.declaration.IsRequired;
@@ -45,6 +55,15 @@ import org.apache.myfaces.tobago.interna
     allowedChildComponenents = {"javax.faces.SelectItem", "javax.faces.SelectItems"})
 
 public interface SelectManyListboxTagDeclaration
-    extends InputTagDeclaration, HasId, IsDisabled, IsRendered, HasBinding, HasTip,
-    IsReadonly, HasConverter, IsRequired, HasMarkup, HasCurrentMarkup, IsDeprecatedInline, HasLabelAndAccessKey {
+    extends HasId, IsDisabled, IsRendered, HasBinding, HasTip,
+    IsReadonly, HasConverter, IsRequired, HasMarkup, HasCurrentMarkup, IsDeprecatedInline, HasLabelAndAccessKey,
+    HasValidator, HasOnchange, HasValueChangeListener,
+    HasValidatorMessage, HasConverterMessage, HasRequiredMessage, HasTabIndex, IsFocus, IsGridLayoutComponent {
+
+  /**
+   * The value of the multi select.
+   */
+  @TagAttribute
+  @UIComponentTagAttribute(type = {"java.lang.Object[]", "java.util.List"})
+  void setValue(String value);
 }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SelectManyShuttleTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SelectManyShuttleTagDeclaration.java?rev=1329643&r1=1329642&r2=1329643&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SelectManyShuttleTagDeclaration.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SelectManyShuttleTagDeclaration.java Tue Apr 24 11:23:26 2012
@@ -25,13 +25,21 @@ import org.apache.myfaces.tobago.apt.ann
 import org.apache.myfaces.tobago.component.RendererTypes;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasBinding;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasConverter;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasConverterMessage;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasCurrentMarkup;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasId;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasInputLabel;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasMarkup;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasOnchange;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasRequiredMessage;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasTabIndex;
 import org.apache.myfaces.tobago.internal.taglib.declaration.HasTip;
-import org.apache.myfaces.tobago.internal.taglib.declaration.InputTagDeclaration;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasValidator;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasValidatorMessage;
+import org.apache.myfaces.tobago.internal.taglib.declaration.HasValueChangeListener;
 import org.apache.myfaces.tobago.internal.taglib.declaration.IsDisabled;
+import org.apache.myfaces.tobago.internal.taglib.declaration.IsFocus;
+import org.apache.myfaces.tobago.internal.taglib.declaration.IsGridLayoutComponent;
 import org.apache.myfaces.tobago.internal.taglib.declaration.IsReadonly;
 import org.apache.myfaces.tobago.internal.taglib.declaration.IsRendered;
 import org.apache.myfaces.tobago.internal.taglib.declaration.IsRequired;
@@ -47,7 +55,15 @@ import org.apache.myfaces.tobago.interna
         "javax.faces.SelectItems"})
 public interface SelectManyShuttleTagDeclaration extends
     IsDisabled, HasId, HasTip, IsRendered, IsRequired, HasBinding, IsReadonly, HasConverter,
-    InputTagDeclaration, HasMarkup, HasCurrentMarkup, HasInputLabel {
+    HasMarkup, HasCurrentMarkup, HasInputLabel, HasValidator, HasOnchange, HasValueChangeListener,
+    HasValidatorMessage, HasConverterMessage, HasRequiredMessage, HasTabIndex, IsFocus, IsGridLayoutComponent {
+
+  /**
+   * The value of the multi select.
+   */
+  @TagAttribute
+  @UIComponentTagAttribute(type = {"java.lang.Object[]", "java.util.List"})
+  void setValue(String value);
 
   /**
    * A localized user presentable label for the left select box.

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java?rev=1329643&r1=1329642&r2=1329643&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java Tue Apr 24 11:23:26 2012
@@ -850,7 +850,7 @@ public class ComponentUtils {
       if (renderer != null) {
         if (component instanceof UISelectMany) {
           final Object converted = renderer.getConvertedValue(facesContext, component, new String[]{stringValue});
-          return ((Object[]) converted)[0];
+          return converted instanceof List ? ((List)converted).get(0) : ((Object[]) converted)[0];
         } else {
           return renderer.getConvertedValue(facesContext, component, stringValue);
         }

Added: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/SelectManyListboxBean.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/SelectManyListboxBean.java?rev=1329643&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/SelectManyListboxBean.java (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/SelectManyListboxBean.java Tue Apr 24 11:23:26 2012
@@ -0,0 +1,48 @@
+package org.apache.myfaces.tobago.example.test;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
+public class SelectManyListboxBean {
+
+  private List<String> list;
+
+  private Set<String> set;
+
+  private Collection<String> collection;
+
+  private String[] array;
+
+  public List<String> getList() {
+    return list;
+  }
+
+  public void setList(List<String> list) {
+    this.list = list;
+  }
+
+  public String[] getArray() {
+    return array;
+  }
+
+  public void setArray(String[] array) {
+    this.array = array;
+  }
+
+  public Set<String> getSet() {
+    return set;
+  }
+
+  public void setSet(Set<String> set) {
+    this.set = set;
+  }
+
+  public Collection<String> getCollection() {
+    return collection;
+  }
+
+  public void setCollection(Collection<String> collection) {
+    this.collection = collection;
+  }
+}

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml?rev=1329643&r1=1329642&r2=1329643&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml Tue Apr 24 11:23:26 2012
@@ -84,6 +84,12 @@
   </managed-bean>
 
   <managed-bean>
+    <managed-bean-name>selectManyListboxBean</managed-bean-name>
+    <managed-bean-class>org.apache.myfaces.tobago.example.test.SelectManyListboxBean</managed-bean-class>
+    <managed-bean-scope>session</managed-bean-scope>
+  </managed-bean>
+
+  <managed-bean>
     <managed-bean-name>selectItemModel</managed-bean-name>
     <managed-bean-class>org.apache.myfaces.tobago.example.test.SelectItemModel</managed-bean-class>
     <managed-bean-scope>session</managed-bean-scope>

Copied: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/selectManyListbox/selectManyListbox-value.xhtml (from r1328229, myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/selectManyListbox/selectManyListbox.xhtml)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/selectManyListbox/selectManyListbox-value.xhtml?p2=myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/selectManyListbox/selectManyListbox-value.xhtml&p1=myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/selectManyListbox/selectManyListbox.xhtml&r1=1328229&r2=1329643&rev=1329643&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/selectManyListbox/selectManyListbox.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/selectManyListbox/selectManyListbox-value.xhtml Tue Apr 24 11:23:26 2012
@@ -20,66 +20,54 @@
     xmlns:tc="http://myfaces.apache.org/tobago/component"
     xmlns:tx="http://myfaces.apache.org/tobago/extension"
     xmlns:ui="http://java.sun.com/jsf/facelets"
-    xmlns:f="http://java.sun.com/jsf/core">
+    xmlns:f="http://java.sun.com/jsf/core"
+    xmlns:h="http://java.sun.com/jsf/html">
 
   <tc:page>
     <tc:gridLayoutConstraint width="630px" height="600px"/>
     <f:facet name="layout">
       <!-- fixme: rows="20px" -->
-      <tc:gridLayout columns="*;2*" rows="auto;20px;auto;auto;auto;auto;auto;auto" columnSpacing="30px"/>
+      <tc:gridLayout rows="70px;70px;70px;70px;70px;70px;70px;70px;auto;auto;auto"/>
     </f:facet>
 
     <tc:messages>
       <tc:gridLayoutConstraint columnSpan="2"/>
     </tc:messages>
 
-    <tc:label value="tc"/>
-    <tc:label value="tx"/>
+    <tc:label value="&lt;tx:selectManyListbox>"/>
 
-    <tc:selectManyListbox>
-      <tc:selectItem itemValue="a" itemLabel="A Value"/>
-      <tc:selectItem itemValue="b" itemLabel="An Alternative"/>
-    </tc:selectManyListbox>
-    <tx:selectManyListbox label="normal">
+    <tx:selectManyListbox value="#{selectManyListboxBean.list}" label="list">
       <tc:selectItem itemValue="a" itemLabel="A Value"/>
       <tc:selectItem itemValue="b" itemLabel="An Alternative"/>
     </tx:selectManyListbox>
-
-    <tc:selectManyListbox readonly="true">
-      <tc:selectItem itemValue="a" itemLabel="A Value"/>
-      <tc:selectItem itemValue="b" itemLabel="An Alternative"/>
-    </tc:selectManyListbox>
-    <tx:selectManyListbox readonly="true" label="readonly">
+    <tx:selectManyListbox value="#{selectManyListboxBean.array}" label="array">
       <tc:selectItem itemValue="a" itemLabel="A Value"/>
       <tc:selectItem itemValue="b" itemLabel="An Alternative"/>
     </tx:selectManyListbox>
-
-    <tc:selectManyListbox disabled="true">
-      <tc:selectItem itemValue="a" itemLabel="A Value"/>
-      <tc:selectItem itemValue="b" itemLabel="An Alternative"/>
-    </tc:selectManyListbox>
-    <tx:selectManyListbox disabled="true" label="disabled">
+<!--
+    <tx:selectManyListbox value="#{selectManyListboxBean.set}" label="set">
       <tc:selectItem itemValue="a" itemLabel="A Value"/>
       <tc:selectItem itemValue="b" itemLabel="An Alternative"/>
     </tx:selectManyListbox>
-
-    <tc:selectManyListbox tip="tip">
-      <tc:selectItem itemValue="a" itemLabel="A Value"/>
-      <tc:selectItem itemValue="b" itemLabel="An Alternative"/>
-    </tc:selectManyListbox>
-    <tx:selectManyListbox tip="tip" label="tip">
-      <tc:selectItem itemValue="a" itemLabel="A Value"/>
-      <tc:selectItem itemValue="b" itemLabel="An Alternative"/>
-    </tx:selectManyListbox>
-
-    <tc:selectManyListbox required="true">
-      <tc:selectItem itemValue="a" itemLabel="A Value"/>
-      <tc:selectItem itemValue="b" itemLabel="An Alternative"/>
-    </tc:selectManyListbox>
-    <tx:selectManyListbox required="true" label="required">
+    <tx:selectManyListbox value="#{selectManyListboxBean.collection}" label="collection">
       <tc:selectItem itemValue="a" itemLabel="A Value"/>
       <tc:selectItem itemValue="b" itemLabel="An Alternative"/>
     </tx:selectManyListbox>
+-->
+<!--
+    <tc:mediator>
+      <h:selectManyListbox value="#{selectManyListboxBean.list}" label="array">
+        <f:selectItem itemValue="a" itemLabel="A Value"/>
+        <f:selectItem itemValue="b" itemLabel="An Alternative"/>
+      </h:selectManyListbox>
+    </tc:mediator>
+    <tc:mediator>
+      <h:selectManyListbox value="#{selectManyListboxBean.array}" label="array">
+        <f:selectItem itemValue="a" itemLabel="A Value"/>
+        <f:selectItem itemValue="b" itemLabel="An Alternative"/>
+      </h:selectManyListbox>
+    </tc:mediator>
+-->
 
     <tc:button label="submit"/>
 

Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/CreateComponentAnnotationVisitor.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/CreateComponentAnnotationVisitor.java?rev=1329643&r1=1329642&r2=1329643&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/CreateComponentAnnotationVisitor.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/CreateComponentAnnotationVisitor.java Tue Apr 24 11:23:26 2012
@@ -51,7 +51,6 @@ import java.io.Writer;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
@@ -378,26 +377,22 @@ public class CreateComponentAnnotationVi
           propertyInfo.setBodyContent(tagAttribute.bodyContent());
           propertyInfo.setTagAttribute(true);
         }
-        String type;
+        final String type;
         if (uiComponentTagAttribute.expression().isMethodExpression()) {
           propertyInfo.setMethodExpressionRequired(true);
           type = "javax.faces.el.MethodBinding";
-        } else if (uiComponentTagAttribute.expression() == DynamicExpression.VALUE_BINDING_REQUIRED) {
-          propertyInfo.setValueExpressionRequired(true);
+        } else {
+          if (uiComponentTagAttribute.expression() == DynamicExpression.VALUE_BINDING_REQUIRED) {
+            propertyInfo.setValueExpressionRequired(true);
+          } else if (uiComponentTagAttribute.expression() == DynamicExpression.PROHIBITED) {
+            propertyInfo.setLiteralOnly(true);
+          }
+
           if (uiComponentTagAttribute.type().length > 1) {
             type = "java.lang.Object";
           } else {
             type = uiComponentTagAttribute.type()[0];
           }
-
-        } else if (uiComponentTagAttribute.type().length == 1) {
-          if (uiComponentTagAttribute.expression() == DynamicExpression.PROHIBITED) {
-            propertyInfo.setLiteralOnly(true);
-          }
-          type = uiComponentTagAttribute.type()[0];
-        } else {
-          throw new IllegalArgumentException(
-              "Type should be single argument " + Arrays.toString(uiComponentTagAttribute.type()));
         }
         propertyInfo.setType(type);
         propertyInfo.setDefaultValue(