• 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

html:select and internationalization

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I'm trying to modify my existing select box. This is how it looks now:


In the action I set the statusList on loading the page. It contains list of pojo's (workmates) that has a property isActive.
The statusList is a property in the Form, so I don't use request.setAttribute("statusList", statusList).
This displays the isActive values nicely in my dropdown box.
Now I have to make a switch by using resource bundle values. the isActive values will be linked to resource bundle. To do that I will need to fill in the dropdown box iteratively and link each statusList items isActive value to the bundle. And the isActive values in the db will be replaced by the keys that are put in the resource. This way the values can be internationalized.
this is how far I got:

This throws the following error: com.caucho.jsp.JspLineParseException: /jsp/PpoAdminListEmployees.jsp:55: attribute `value' in tag `bean:message' has no corresponding set method in tag class `org.apache.struts.taglib.bean.MessageTag'
What am I missing here?

Update: This throws nullPointerException

[ September 13, 2005: Message edited by: Ergin Er ]
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to use the value of the "id" that you are iterating on.
I haven't actually tried the following code, but it gives the general idea

<logic:iterate id="id" name="ppoadminemployees" property="statusList">
<html:option bundle="msg"><bean:write name="id" property="isActive"/></html:option>
</logic:iterate>

or maybe:
<logic:iterate id="id" name="ppoadminemployees" property="statusList">
<html:option bundle="msg" key="<%= id.getIsActive() %>"/>
</logic:iterate>
[ September 13, 2005: Message edited by: Stefan Evans ]
 
Ergin Er
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot dude. Your code didn't work but it did help me on my way. The id that I had to iterate on is in this case workmate and the bundle had to be placed in the section message where I write the interation results to the select box.

This is the working code:
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic