Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

h:panelGrid + ui:repeat tag issue

 
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.
 
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.
 
Ranch Hand
Posts: 643
Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did anyond found solution for this problem?
 
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">
 
Saloon Keeper
Posts: 22482
151
Android Eclipse IDE Tomcat Server Redhat Java 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.
 
He got surgery to replace his foot with a pig. He said it was because of this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic