• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

html:select and internationalization

 
Ergin Er
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • 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 ]
 
Stefan Evans
Bartender
Posts: 1807
10
  • Mark post as helpful
  • send pies
  • 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">
<htmlption bundle="msg"><bean:write name="id" property="isActive"/></htmlption>
</logic:iterate>

or maybe:
<logic:iterate id="id" name="ppoadminemployees" property="statusList">
<htmlption 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
  • 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:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic