aspose file tools*
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
Author

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.

Kalai.
Marc-Andre Poitras
Greenhorn

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
Greenhorn

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: 16242
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: h:panelGrid + ui:repeat tag issue