• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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................
 
my overalls have superpowers - they repel people who think fashion is important. 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