We never used any hashmaps in List as the data holders. Always we use
the java beans (with getter and setter) in list.

Here is the sample code.
Get_States is the request attribute name for the list.
Code and description are two properties in the beans added to the list.

<html:options collection="Get_States" property="code"
labelProperty="description"/> 

Bala

-----Original Message-----
From: Daniel Henrique Ferreira e Silva [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 02, 2005 5:54 AM
To: Struts Users Mailing List
Subject: Question about html:options

Hi all,

I've been using Struts for some time now and suddenly faced this issue
that i'm not sure it's a bug or a misinterpretation of mine.

I have a List in request scope holding HashMaps. Then, i tried to use
<html:options/> like this:

<html:options collection="myList" property="value"
labelProperty="label"/>

My HashMap instances have two entries each one: value => some value
and label => value's label.

Quite strange that didn't work. After replacing HashMaps to POJOs it
worked.

Aren't maps supported by <html:options/>?
If not, it's not clear enough in documentation.
If they are, could you please point me to a simple sample?

Thanks in advance,
Daniel Silva.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to