Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to display list of objects in turn each object contains one more list using jsf2.0 datatable?

 
prasad kakani
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use nested tables, See the example here
And the rest expand collapse you can perform through javascript..
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic