Have a look at the following messages which discuss the addition of such
feature.
In this message you'll find some source code that can help you until
hopefully this gets into the commons.
http://www.mail-archive.com/[email protected]/msg02804.html

Fr.

http://www.mail-archive.com/[email protected]/msg02864.html
http://www.mail-archive.com/[email protected]/msg02863.html
http://www.mail-archive.com/[email protected]/msg02849.html
http://www.mail-archive.com/[email protected]/msg02847.html
http://www.mail-archive.com/[email protected]/msg02843.html

http://www.mail-archive.com/[email protected]/msg02805.html
http://www.mail-archive.com/[email protected]/msg02804.html
http://www.mail-archive.com/[email protected]/msg02802.html
http://www.mail-archive.com/[email protected]/msg02801.html


-----Original Message-----
From: Will Jaynes [mailto:[EMAIL PROTECTED]]
Sent: 15 August 2001 13:36
To: [EMAIL PROTECTED]
Subject: Re: Displaying a hashmap through html:options


The options tag doesn't permit the use of a Hashmap. A Hashmap is not
actually a
Collection, since it doesn't implement the Collection interface. Perhaps
this
utility is a possible enhancement for the options tag.

----- Original Message -----
From: "Ganendran Kumaraswamy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 15, 2001 4:45 AM
Subject: Displaying a hashmap through html:options


I have created and set a hashmap called "hm" in the request object in my
action class.  Action class forwards it to a JSP page. In the JSP page, I
have the following line to get the bean into the page.

<bean:define id="hmap" name="hm" scope="request" type="java.util.HashMap"/>

I am trying to populate the options tag using the data in the hashmap. I
want the keys of the hashmap to be the value of the <option> tag in html and
the value of the hashmap to be the displayed text.

Currently I have something like,

<html:select property="singleSelect" size="6">
<html:options collection="hmap" property="hmap" labelProperty="hmap" />
</html:select>

This doesnt seem to work.  Any ideas ?




************************************************************************
The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***********************************************************************

Reply via email to