title: JSF Composite component and selectItems
body: <p>I have been playing around with composite components and I ran into something I could not figure out. Without using a composite component I would have something like this:</p>
  
  <pre><code>&lt;h:outputText value="Some Label:"/&gt;
  &lt;h:selectOneMenu"&gt;
    &lt;f:selectItem itemLabel="Item 1"/&gt;
    &lt;f:selectItem itemLabel="Item 2"/&gt;
    &lt;f:selectItem itemLabel="Item 3"/&gt;
  &lt;/h:selectOneMenu&gt;
  </code></pre>
  
  <p>I essentially turned that snippet into a composite component:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"  
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:composite="http://java.sun.com/jsf/composite"&gt;
  
    &lt;!-- INTERFACE --&gt;
    &lt;composite:interface&gt;
      &lt;composite:attribute name="label" required="true"/&gt;
      &lt;composite:attribute name="options" required="true"/&gt;      
    &lt;/composite:interface&gt;
  
    &lt;!-- IMPLEMENTATION --&gt;          
    &lt;composite:implementation&gt;
      &lt;h:outputText value="#{cc.attrs.label}"/&gt;
      &lt;h:selectOneMenu style="width:140px;"&gt;
          &lt;f:selectItem value="#{cc.attrs.options}" /&gt;
      &lt;/h:selectOneMenu&gt;  
    &lt;/composite:implementation&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Now here is where I am stumped. I know I could put the list of items I want to use in the component in a backing bean and use it like this:</p>
  
  <pre><code>&lt;util:dropdown label="Some Label:" options="#{backingBean.list}"/&gt;
  </code></pre>
  
  <p>The real question is if there is a way to pass in the options without having to use a backing bean? I guess something like:</p>
  
  <pre><code>&lt;util:dropdown label="Some Label:" options="Item 1, Item 2, Item 3"/&gt;
  </code></pre>
  
  <p>or maybe</p>
  
  <pre><code>&lt;util:dropdown label="Some Label:" options="#{backingBean.list}"&gt;
       &lt;f:selectItem itemLabel="Item 1"/&gt;
       &lt;f:selectItem itemLabel="Item 2"/&gt;
       &lt;f:selectItem itemLabel="Item 3"/&gt;
  &lt;/util:dropdown&gt;
  </code></pre>
  
  <p>Note: obviously those two do not work or I would not be asking the question.</p>