• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to pass a value to end attribute of <c:forEach />

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to print no. of Text fields dynamically by using <c:forEach />.
How to pass a value to end attribute?
Is there any alternate for <c:forEach/>
Please help me.



thanks in advance....,
 
Bartender
Posts: 1845
10
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The standard tag for looping in JSF would be the <h:dataTable>

If you want "x" text fields on the page, on your backing bean, have a list initialized to size "x", and then loop through it with the dataTable tag.
It should then automatically bind the values back into that same list in the bean.

 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stefan Evans wrote:The standard tag for looping in JSF would be the <h:dataTable>



Nope. I'm going to be pedantic here. A dataTable is a 2-dimensional display structure. HOW it gets generated is immaterial. It could have just as easily been done via parallel processing for all the final display cares. Looping is just one way.

The reason for being so nit-picky about such stuff is that when you think solely in terms of logic, your solutions will tend to be colored in terms of logic. Don't mistake the means for the goal!

And (as I've said before) for a long an happy life, DON'T mix JSTL and JSF!
 
reply
    Bookmark Topic Watch Topic
  • New Topic