struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Balasubramaniam, Sezhiyan" <sbalasubraman...@ebay.com>
Subject RE: Question about html:options
Date Wed, 02 Nov 2005 14:22:29 GMT
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:dhsilva@gmail.com] 
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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message