• 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

render combo box

 
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
i am new to struts. I want to render combobox with map values(key,value).

my code is in the following way..
<html:select property = "cucl" name = "customerForm">
<html ptionsCollection name = "customerForm" property="custGroupsMap" value="cucl" label="desc" />

i wrote set and get method for cucl,desc in customerForm..


I am getting following error:



No getter method available for property desc for bean under name 018=Agent


How can i solve this problem.

Thanks
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If custGroupsMap is a Map, change your code to the following:

When a Struts tag iterates over a Map, each iteration produces an object of type Map.Entry, which has key and value properties.
[ January 21, 2008: Message edited by: Merrill Higginson ]
 
Bacchi Gerem
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your responce.
I need combobox with key and vaue .but it is displaying onle value in combo box. if i save the combo box item. The key will save to database.
If i relogin in to application i want the selected item in the combo box .
But i am getting the selected item is maps first item in the combo box.

How can i change the combo box item..

Thanks
 
Bacchi Gerem
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
do i need to write set and get methods for key & value?Please let me know.

Thanks
 
Bacchi Gerem
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please anybody help me................
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic