I am using JSF 2.0 in my project. I am struck with the implementation. Currently I am implementing a composite component for data table / tree table. I am creating a generic component for datatable and treetable. User using this composite component has to pass a boolean to say display data in tree table or data table.
<cc:attribute name="treeMode" default="false" type="java.lang.Boolean"/>
<p:dataTable rendered="#{cc.attrs.treeMode == 'false'} id="#{cc.attrs.id} value=".../>
<p:treeTable rendered="#{cc.attrs.treeMode == 'true'}" id="#{cc.attrs.id} value=".../>
If I need datatable, i use
<nav:navDataGrid
id="testTable"
treeMode="true"
databean="testBean" .../>
I am also passing ID attribute. But my problem is when use the composite component using the above code I am getting
Component ID testTable:testTable has already been found in the view.
I think that is because it is rendering both data table and tree table. When I pass treeMode=tree, why datatable is getting rendered ? How can I resolve this ? Is there any other option other that creating one more composite component for TreeTable ?