I am trying to populate a table...this table has 3 columns... 1. Name of a property 2. Value of Property from entity1 3. Value of Property from entity2
The backing bean has a propertiesList which is an arraylist and this in turn has 2 property lists 1. propertyList1 2. propertyList2 which in turn are arraylists.
each property in above lists is a Property object with the name value pair...
How do i achieve this scenario using h:dataTable...
then what? how do I iterate through both the propertyist1 and list2 and display the values as requested above?...Lets assume the order of the names of attributes are in sync for both the lists
"In theory, there is no difference between theory and practice. But, in practice, there is."<br /> - Jan L.A. van de Snepscheut
1. Create a UI Bean that will store the values you want in the table in a single collection structure. This would require more code and you looping through your two lists to combine them into one big list.
2. Use a third party JSF datatable that supports sub-tables.
3. Nest jsf datatables, the inner datatable using the var from the outertable to get to the inner list.