i have a parent class including two others that inherit from this parent class and i retrieve a list of objects from this parent class and I have a datatable share in two parts using column group to represent each object that arise from the parent and at the datatable i want to add a condition for example if this object is X display it in the column of X otherwise I display it in the column of Y.
Here is my dataTable
<p:dataTable var="etp" value="#{etpBean.etps}">
<f:facet name="header">
Equivalent temps de travail
</f:facet>
<p:columnGroup type="header">
<p:row>
<p:column rowspan="3" headerText="Ressource" />
<p:column colspan="4" headerText="Centre des coûts" />
</p:row>
<p:row>
<p:column colspan="3" headerText="Activite" />
<p:column colspan="3" headerText="Projet" />
</p:row>
<p:row>
<p:column headerText="Nom" />
<p:column headerText="Prise en charge" />
<p:column headerText="Charge réelle" />
<p:column headerText="Nom" />
<p:column headerText="Prise en charge" />
<p:column headerText="Charge réelle" />
</p:row>
</p:columnGroup>
<p:column>
<h:outputText value="#{etp.affectation.ressource.nom}" />
</p:column>
<!-- Here I display the first object -->
<p:column>
<h:outputText value="#{etp.parent.nom}" />
</p:column>
<p:column>
<h:outputText value="#{etp.etp}%" />
</p:column>
<p:column>
<h:outputText value="#{etp.chargeActivite}%" />
</p:column>
<!-- Here I display the second object -->
<p:column>
<h:outputText value="#{etp.parent.nom}" />
</p:column>
<p:column>
<h:outputText value="#{etp.etp}%" />
</p:column>
<p:column>
<h:outputText value="#{etp.chargeActivite}%" />
</p:column>
<p:columnGroup type="footer">
<p:row>
<p:column colspan="2" footerText="Totals:" />
<p:column footerText="" />
<p:column footerText="$#{etpBean.chargeTotal}%" />
</p:row>
</p:columnGroup>
</p:dataTable>
For the moment the data are duplicate on the columns and this normal This is normal since i do not make any conditions
And i want to group this column on the whole list of objects since it will repeat the same on all lines
<p:column>
<h:outputText value="#{etp.affectation.ressource.nom}" />
</p:column>