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

Variable number of columns within dataTable

 
Rory Evans
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

On my backing bean, I have a list of Player objects. Each Player object has a list of Card objects.

On my jsf page, I want to display a dataTable with one row per Player and one column per Card. Since each player may have a different number of cards, I need to have a way of determining how many columns to create.

My initial idea was to use something like:



but this renders no columns at all (after reading around the subject, I understand why this is the case). Can anyone suggest a suitable alternative or workaround for the problem described above?

Thanks
 
Tim Holloway
Saloon Keeper
Posts: 18303
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're not the first one to discover that the ui:repeat element doesn't work well in tables.

Your best bet, I think, is to bind the table itself to a backing bean and construct the columns in backing bean code. Or you could use the RichFaces DataGrid control.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic