how to display list of objects in turn each object contains one more list using jsf2.0 datatable?
prasad kakani
Ranch Hand
Joined: Jul 15, 2008
Posts: 59
posted
0
Hi All,
I need to display list of objects in turn each object contains one more list using jsf2.0 datatable. I mean the requirement is like this.
StudentVO {
private string name;
private string failedSubjects[];
private string passedSubjects[];
}
Here i need to display list of students in datatable.
<h:dataTable id="studentID" var="studentVO" value="#{demandManagedBean.allStudentsList}" >
<h:column>
<f:facet name="header">
name
</f:facet>
</h:column>
<h:column>
<f:facet name="header">
failedSubjects // how to retrieve the these failed objects? </f:facet>
</h:column>
</h:datatable>
Nikhil Padharia
Ranch Hand
Joined: Apr 19, 2012
Posts: 37
posted
0
prasad kakani wrote: failedSubjects // how to retrieve the these failed objects?
You can have a getter method in your class returning String of comma seperated failedSubjects or as desired in the output
This can be displayed on page using
prasad kakani
Ranch Hand
Joined: Jul 15, 2008
Posts: 59
posted
0
Hi Nikhil,
i need to display these failed subjects values in another rows .how this can be done in jsf datatable?
Nikhil Padharia
Ranch Hand
Joined: Apr 19, 2012
Posts: 37
posted
0
You can use nested tables, See the example here And the rest expand collapse you can perform through javascript..