File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes h:panelGrid + ui:repeat tag issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "h:panelGrid + ui:repeat tag issue" Watch "h:panelGrid + ui:repeat tag issue" New topic

h:panelGrid + ui:repeat tag issue

Kalai Selvan
Ranch Hand

Joined: Jul 07, 2004
Posts: 79
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.

Marc-Andre Poitras

Joined: Jun 11, 2009
Posts: 1
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

Joined: Nov 03, 2001
Posts: 626

Did anyond found solution for this problem?
Xiaonan Jiang

Joined: Jun 24, 2010
Posts: 1
Please try to use c:forEach to replace ui:repeat.

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

Joined: Jun 25, 2001
Posts: 17417

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.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: h:panelGrid + ui:repeat tag issue
It's not a secret anymore!