| Author |
Display using DataTable
|
Veera Velisetti
Greenhorn
Joined: Jan 27, 2010
Posts: 5
|
|
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
Joined: Mar 09, 2008
Posts: 106
|
|
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:
|
SCJP 5, SCJD 5, SCWCD 5, SCBCD 5, SCJDWS 5
My SCBCD-Notes - My Hello World Webservice
|
 |
 |
|
|
subject: Display using DataTable
|
|
|