title: Parameterizing managed bean instance as composite component attribute
body: <p>I've been searched how to parametrize the Managed Bean class, and until now nothing.</p>
  
  <p><strong>What I'm doing?</strong> </p>
  
  <p>I have a JSF component that access some methods from my Bean, but this methods are already implemented by an abstract Class.</p>
  
  <p>The name of the methods and attributes don't change, but now I'm copying and pasting, changing only the Bean name.</p>
  
  <p>The first implementation is work, but I would like to improve with the second one.</p>
  
  <p><strong>1- Component (Now):</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>...
  &lt;cc:interface&gt;
      &lt;cc:attribute name="title"         type="java.lang.String"  required="true"/&gt;
      &lt;cc:attribute name="data"          type="java.util.List"    required="true"/&gt;
      &lt;cc:attribute name="columnModel"   type="java.util.List"    required="true"/&gt;
      &lt;cc:attribute name="newEntity"     type="java.lang.Object"  required="true"/&gt;
      &lt;cc:attribute name="crudState"     type="java.lang.Integer" required="true"/&gt;
  &lt;/cc:interface&gt;
  ...
  &lt;cc:implementation&gt;
      &lt;p:dataTable var="entity" value="#{cc.attrs.data}" &gt;
          &lt;p:columns value="#{cc.attrs.columnModel}" 
              var="column" style="#{column.style}" 
              styleClass="#{column.styleClass}"&gt;
          ...
          &lt;/p:columns&gt;
      &lt;/p:dataTable&gt;
  &lt;/cc:implementation&gt;
  ...
  </code></pre>
  
  <p><strong>1- Implementations (Now):</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>    ...
      &lt;comp:crud 
          title="#{cfgUserBean.title}"
          data="#{cfgUserBean.data}"
          columnModel="#{cfgUserBean.coluuns}"
          newEntity="#{cfgUserBean.newEntity}"
          newEntity="#{cfgUserBean.crudState}"/&gt;
      ...
      &lt;comp:crud 
          title="#{cfgCityBean.title}"
          data="#{cfgCityBean.data}"
          columnModel="#{cfgCityBean.columns}"
          newEntity="#{cfgCityBean.newEntity}"
          crudState="#{cfgCityBean.curdState}"/&gt;
  </code></pre>
  
  <p><strong>Desired:</strong></p>
  
  <p>Pass the Bean Name as a Parameter</p>
  
  <p><strong>2- Component (Desired):</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>...
  &lt;cc:interface&gt;
      &lt;cc:attribute name="BEANNAME" type="java.lang.Object"  required="true"/&gt;
  &lt;/cc:interface&gt;
  ...
  &lt;cc:implementation&gt;
      &lt;p:dataTable var="entity" value="#{cc.attrs.BEANNAME.data}" &gt;
          &lt;p:columns value="#{cc.attrs.BEANNAME.columnModel}" 
              var="column" style="#{column.style}" 
              styleClass="#{column.styleClass}"&gt;
          ...
          &lt;/p:columns&gt;
      &lt;/p:dataTable&gt;
  &lt;/cc:implementation&gt;
  </code></pre>
  
  <p><strong>2- Implementations (Desired):</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>    ...
      &lt;comp:crud BEANNAME="cfgUserBean" /&gt;
      ...
      &lt;comp:crud BEANNAME="cfgCityBean" /&gt;
  </code></pre>
  
  <p><strong>Conclusion</strong></p>
  
  <p>As you can see, If I could parametrize the Bean name, I would be able to simplify a lot the final coding.</p>
  
  <p>Any one with any Idea what I could do?
  Thank you in advance</p>