Hi,
I've been doing
JSF for a while now, and I've encountered a hitch which I can't seem to get my mind around.
I recently built a prototype which used a panelGrid to show static items in a grid layout with 4 columns. Items 1 - 4 in the first row, 4 - 8 in the second, etc.
Now I want to dynamically populate the grid with data items (a List) from a managed bean. So the panelGrid must be replaced with a dataGrid, right?
Only now the dataGrid shows one item per row, so I can't reproduce the panelGrid layout I have in the prototype.
So what to do?
As I see it, I have three or four options:
1. Build a ton of logic into my bean to allow me to iterate through the items in the the List one at a time. Surely this shouldn't be necessary.
2. Integrate JSTL into my web page and use it to iterate through the List with a <c:forEach/>. (I read an article on devx.com explaining this,
http://www.devx.com/Java/Article/21020/0/page/1 but I tried it with luck so far. JSTL doesn't seem to read the List from the session. Any code examples would be really helpful! I'll post what I have if this helps you to help me!)
3. Use a third-party 'data-aware' JSF component that supports this layout option. Any suggestions?
4. Use some clever JSF expressions to access the items offset from the current one, like #{MyBean.listItems[n+1]}, but I haven't really researched this one too much as to know if it's even possible.
Number 2 is my prefered option at the moment.
TIA for your input.
[ August 13, 2005: Message edited by:
Alan Biggs ]
[ August 13, 2005: Message edited by: Alan Biggs ]
[ August 13, 2005: Message edited by: Alan Biggs ]