wood burning stoves 2.0*
The moose likes Struts and the fly likes render combo box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "render combo box" Watch "render combo box" New topic
Author

render combo box

Bacchi Gerem
Ranch Hand

Joined: Jan 23, 2004
Posts: 120
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

Joined: Feb 15, 2005
Posts: 4864
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 ]

Merrill
Consultant, Sima Solutions
Bacchi Gerem
Ranch Hand

Joined: Jan 23, 2004
Posts: 120
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

Joined: Jan 23, 2004
Posts: 120
do i need to write set and get methods for key & value?Please let me know.

Thanks
Bacchi Gerem
Ranch Hand

Joined: Jan 23, 2004
Posts: 120
Please anybody help me................
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: render combo box
 
Similar Threads
Spring MVC: How to handle to different command object for two different forms
html:option
Getting an error
Map with html:optionCollection
JSTL vs struts tag