Meaningless Drivel is fun!*
The moose likes Struts and the fly likes for loop in select struts tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "for loop in select struts tag" Watch "for loop in select struts tag" New topic
Author

for loop in select struts tag

garfild Baram
Ranch Hand

Joined: Mar 24, 2003
Posts: 60
Hi,
I have the following code:
<html:select styleClass="drpdwn" property="activationTimeFrameStart" >
<html ption value="00">00</html ption>
<html ption value="01">01</html ption>
<html ption value="02">02</html ption>
...
...
<html ption value="10">10</html ption>
<\html:select>
It shows listbox 0f numbers between 00 - 10 or what ever I descide.
I need to use a loop for saving me the code (if I need let say 60 option values).
How can I do it?
Thanks
Jo
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30130
    
150

You can use the <logic:iterate> tag.
ps - Next time use the code tags to avoid getting the icons.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
ps - Next time use the code tags to avoid getting the icons.
This is generally a good idea, but for short excerpts it's also a good idea to check the "Disable smilies in this post." box below the list of little faces.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

Moving to the Struts forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
garfild Baram
Ranch Hand

Joined: Mar 24, 2003
Posts: 60
Thanks guys for your advise.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: for loop in select struts tag
 
Similar Threads
html:select and html:options question
update html:options
HTML:SELECT
how to set option to default ?
html:select in Struts