File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Display using DataTable

 
Veera Velisetti
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a list of items. Lets say list has the following elements: A,B,C,D,E,F.
I want to display these elements in a h:dataTable in the following manner.

A B C
D E F

arranged in 3 cols and in the said fashion above.
I am new to JSF and am struggling to get it.
If any one has some sample code or any pointers, please post it back.
That will be of great help.

Veera
 
Christian Nicoll
Ranch Hand
Posts: 106
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Veera,

I don't think that the h:datatable is a good way to solve this problem. I would use the datatable component for collections of complex objects, but to display simple strings in a table I would use the h:panelGrid tag:


Note that I've use the forEach-tag of the JSTL and so I had to make sure that the JSTL is installed on my server. To complete the coding you need a PoJo which you bind to the myBean variable (faces-config.xml).

Your Bean needs a getItems method:
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic