Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

h:panelGrid + ui:repeat tag issue

 
Kalai Selvan
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am trying to build columns in the h:panelGrid tag dynamically using facelets repeat tag (ui:repeat). My code looks like this:



The output it generated is



All the 4 elements (Emp. No,First Name,Middle Name,Last Name) of the "preferencesBean.columns" in single TD instead of creating 4 different TDs.

Is there any solution or work around available for this?

Thanks in advance.

Kalai.
 
Marc-Andre Poitras
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having the same problem. Anyone else found a solution?



results in this



I don't understand why there is only one row. Each Panel group should be one column, and there should only be two columns. I suspect it has to do with the way JSF generates the HTML at separate time so when that at the time the table is created, the data is not present.
 
Jignesh Patel
Ranch Hand
Posts: 626
Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did anyond found solution for this problem?
 
Xiaonan Jiang
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please try to use c:forEach to replace ui:repeat.

<c:forEach items="#{preferencesBean.columns}" var="item">
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18096
49
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Xiaonan Jiang wrote:Please try to use c:forEach to replace ui:repeat.

<c:forEach items="#{preferencesBean.columns}" var="item">


Please don't. Mixing JSTL and JSF is a bad idea.

I looked at doing something similar to this, but ended up using the RichFaces dataGrid control instead. It's actually designed for that kind of thing.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic