Originally posted by Yasir Qureshi:
I want to display list A and also list B which is contained by list A, in the same data table.
In you backing add two HTMLDatatables
private HtmlDataTable dataTableA;
private HtmlDataTable dataTableB;
private List ListA ;
private List ListB ;
On your web page link:
<h:dataTable id="itemsA" bindings="#{bbean.dataTableA}" value="bbean.ListA">
<h:dataTable id="itemsB" bindings="#{bbean.dataTableB}" value="bbean.ListB" rendered="false">
Add the entries of ListA to dataTableA
Add A commandLink to a column in dataTableA which calls a method in the backing bean:
ex:
<h:commandLink action="#{bbean.selectDetail}">
<h:outputText value="Show Detail"/>
</h:commandLink>
in the backin bean method set the rendering for tableB to true
public void selectDetail(){
ListB = ListA.ListBData
ListB.setRendered(true)
}
You will then display your data as a sort of Master/Detail record on the web page.