• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF and Tables

 
Lukas Stadler
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for the question but i'm completely new to jsf 2.0 and are trying to use a table with some speciality.

the table should look something like this



I'd like to iterate over a List of info Elements and fill the stuff into the table. All titel, info1, info2, info3, info4 are members of the class info. so i should be able to iterate over them.

If i do something like that


I can't get the table structure as described above.


So I tried to do it somehow like that:




But I can't get it working.

How do you implement a table like I want in jsf???

Thanks
 
Tim Holloway
Bartender
Posts: 18412
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"I can't get it to work" doesn't tell us anything. What is it doing wrong?

Incidentally, you cannot just bind the collection to the dataTable tage, if that's what you're trying to do. You have to wrap the collection in a DataModel object and provide a getter for the datamodel object.
 
Lukas Stadler
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With icefaces I can use <ice:columnGroup> and <ice:column groupOn="#{...}"> to get it working. But icefaces 2.0 is still alpha and I'd lke to use JSF 2.0. My problem is, that I don't know how to use the dataTable element with the glassfish implementation (mojarra) to get exactly that grouping.

You can see the grouping with icefaces working in http://component-showcase.icefaces.org/component-showcase/showcase.iface under Table - grouping, so how do I do that with mojarra. I can't find the needed components to get it working
 
Tim Holloway
Bartender
Posts: 18412
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Grouping isn't supported in core JSF dataTable. The core datatable is quite minimalist. For stuff like that, you'd need IceFaces or some similar extension like RichFaces (which also supports grouped tables).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!