title: How to pass attributes to a composite-component
body: <p>I am having trouble in using a JSF composite-component in the right way. I put some components together and everything was working. Then I just extracted the code to a composite-component, and passed the corresponding attributes and suddenly I am getting conversation exceptions.</p>
  
  <pre><code>&lt;composite:interface&gt;
      &lt;composite:attribute name="selectedIDs"  type="java.util.Collection" required="true"/&gt;
      &lt;composite:attribute name="selectItems" type="java.util.List" required="true" /&gt;    
      &lt;composite:attribute name="addAction" required="true"/&gt;
      &lt;composite:attribute name="deleteAction" required="true"/&gt;
      &lt;composite:attribute name="deleteButtonDisabled" /&gt;
      &lt;composite:attribute name="ajaxListener" method-signature="void listener(javax.faces.event.AjaxBehaviorEvent)"/&gt;
  &lt;/composite:interface&gt;
  &lt;composite:implementation&gt;
  &lt;div class="myClass"&gt;
      &lt;h:outputStylesheet library="views" name="selectManyControlPanel.css" target="head" /&gt;
  
      &lt;h:form&gt;
          &lt;h:selectManyListbox value="#{cc.attrs.selectedIDs}"&gt;
              &lt;f:selectItems value="#{cc.attrs.selectItems}" /&gt;
              &lt;f:ajax render="delete"
                  listener="#{cc.attrs.ajaxListener}" /&gt;
          &lt;/h:selectManyListbox&gt;
          &lt;br /&gt;
          &lt;h:commandButton id="delete" value="Delete"
              disabled="#{cc.attrs.deleteButtonDisabled}"
              action="#{cc.attrs.deleteAction}" /&gt;
          &lt;h:commandButton id="add" value="Add" action="#{cc.attrs.addAction}"/&gt;
      &lt;/h:form&gt;
  &lt;/div&gt;
  &lt;/composite:implementation&gt;
  </code></pre>
  
  <p>Here is the page where I am using the newly created component</p>
  
  <pre><code>&lt;view:selectManyControlPanel 
              selectedIDs="#{bean.selectedIds}" 
              selectItems="#{bean.listOfSelectItems}"
              addAction="#{bean.addNew}"
              deleteAction="#{bean.deleteSelection}"
              ajaxListener="#{bean.selectionChanged}"
              deleteButtonDisabled="#{bean.deleteButtonDisabled}" /&gt;
  </code></pre>
  
  <p>Bean (some methods skipped an parts renamed)</p>
  
  <pre><code>package views;
  
  @SuppressWarnings("serial")
  @Named
  @RequestScoped
  public class Bean implements Serializable, IOverviewView {
  
      @Inject
      Presenter presenter;
      private boolean deleteButtonDisabled;
  
      private List&lt;SelectItem&gt; listOfSelectItems;
  
      private Set&lt;Long&gt; selectedIds;
  
  
      public Bean(){
          deleteButtonDisabled = true;
          listOfSelectItems = new ArrayList&lt;SelectItem&gt;(10);
      }
  
  
      public void selectionChanged(AjaxBehaviorEvent event){
          if(selectedIds.isEmpty())
              deleteButtonDisabled = true;
          else
              deleteButtonDisabled = false;
      }
  
      public void deleteBikes(){
          presenter.delete(selectedIds);
      }
  
      public void addNew(){
          presenter.addNew();
      }
  
      public List&lt;SelectItem&gt; getListOfSelectItems() {
          return listOfSelectItems;
      }
  
      public Set&lt;Long&gt; getSelectedIds() {
          return selectedIds;
      }           
  
      @PostConstruct
      public void init(){
          System.out.println("INITIALIZING BEAN: " + this.getClass().getName());
          this.presenter.setView(this);
          this.presenter.init();
      }
  
      public boolean isDeleteButtonDisabled() {
          return deleteButtonDisabled;
      }
  
      @Override
      public void setDeleteButtonEnabled(boolean isEnabled) {
          deleteButtonDisabled = !isEnabled;
      }
  
      public void setListOfSelectItems(List&lt;SelectItem&gt; list) {
          this.listOfSelectItems = list;
      }
  
      public void setSelectedIds(Set&lt;Long&gt; selectedIds) {
          this.selectedIds = selectedIds;
      }
  
  
      @Override
      public void updateBikesList(Set&lt;ViewObject&gt; objectsToDisplay) {
          updateList(objectsToDisplay);
      }
  
  
      private void updateList(Set&lt;ViewObject&gt; objectsToDisplay){
          listOfSelectItems.clear();
          for (ViewObject vO : objectsToDisplay) {
              final String label = vO.getManufacturer() + ", " + vO.getModel() + " (" + vO.getYear() + ")";
              listOfSelectItems.add(new SelectItem(vO.getId(), label));
          }
      }
  ....
  
  }
  </code></pre>
  
  <p>Exception</p>
  
  <pre><code>javax.el.ELException: /resources/views/selectManyControlPanel.xhtml @25,56 value="#{cc.attrs.selectedIDs}": /index.xhtml @21,70 selectedIDs="#{bean.selectedIds}": Cannot convert [Ljava.lang.String;@1e92093 of type class [Ljava.lang.String; to interface java.util.Set
  </code></pre>
  
  <p>The only thing that changed is that I am using the composition instead of the plain code. The EL-expressions are still the same. Can someone enlighten me please? I expected that the parameters are just passed through but obviously not...</p>