Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

render combo box

 
Bacchi Gerem
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • 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
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
Please anybody help me................
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic