• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Code optimization for html:option tag

 
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I would like to optimize the following code :

<html:select property="selectedItem">
<html ption value="1">show topics for last 1 day</html ption>
<html ption value="2">show topics for last 2 day</html ption>
<html ption value="3">show topics for last 3 day</html ption>
<html ption value="4">show topics for last 4 day</html ption>
<html ption value="5">show topics for last 5 day</html ption>
<html ption value="6">show topics for last 6 day</html ption>
:
:
:
<html ption value="31">show topics for last 31 days</html ption>
</html:select>

If you have any suggestions, please let me know
regards
sudha
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You may try the following, if you have the option of using <html-el:xxxx> tags -


[ August 30, 2007: Message edited by: Bhaskar Reddy ]
 
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can create an array of LabelValueBeans and use html:optionsCollection:

Action Class:

JSP:
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic