Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

populate a combo drop down box by using the values defined in a resource file

 
divya chamarti
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can any body help me to tell how to populate a combo drop down box by using the values defined in a resource file under \classes folder in struts???
 
RoshaniG Gopal
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
you may do it as follows:

<html:select property="location" styleClass="small">
<html ption value="0">
<bean:message key="feature.admin.option.value"/>
</html ption>

Regards,
Roshani
 
divya chamarti
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks roshani
but i think it will work 4 only one option but there is suppose 5 options i mean the options i want to iterate more than 1 times and the values must be from the resource file itself
regards
 
RoshaniG Gopal
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi divya,
Please try it and i think it should work. All the values will come from the resource file only. You may use it as in the <html:select>.
<html ption value="0">
<bean:message key="feature.admin.option1.value"/>
</html ption
<html ption value="0">
<bean:message key="feature.admin.option2.value"/>
</html ption>

Do you want to use <bean:iterate> ???
Incase it doesnt please let me know the exact problem that you are facing.
Regards,
Roshani
 
divya chamarti
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Roshani
exacly i want to use <logic:iterate tag for populating the combo box instead of writing the multiple <html ption tag for multiple values
and the values should come from the resource file itself
if you can tell me please tell me i'm waiting for your response
regards ,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic