You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Shrinivas Parashar <Sh...@symantec.com> on 2012/03/28 12:13:31 UTC

Using HashMap in selectbox

Hi,
How can use a hashMap in select box with Map key as listkey and Map values one of the property as listValue.
For example I have a Map of type <String,Person> . In the listValue I want to provide person.name. Is this possible?

Regards,
Shrinivas

Re: Using HashMap in selectbox

Posted by Steven Yang <ke...@gmail.com>.
i think you can turn the map to a Set<Entry<K, V>> then use it as listKey
as "getKey()" or "key" and listValue as "getValue()" or "value"

On Wed, Mar 28, 2012 at 6:16 PM, Rakeshkumar Parmar <
rakeshkumar_parmar@persistent.co.in> wrote:

> I think it requires list. So you can get values from hashmap using
> values() method.then apply person.name.
>
>
> Regards,
> Rakesh
>
> -----Original Message-----
> From: Shrinivas Parashar [mailto:Shrinivas_Parashar@symantec.com]
> Sent: Wednesday, March 28, 2012 3:44 PM
> To: Struts Users Mailing List
> Subject: Using HashMap in selectbox
>
> Hi,
> How can use a hashMap in select box with Map key as listkey and Map values
> one of the property as listValue.
> For example I have a Map of type <String,Person> . In the listValue I want
> to provide person.name. Is this possible?
>
> Regards,
> Shrinivas
>
> DISCLAIMER
> ==========
> This e-mail may contain privileged and confidential information which is
> the property of Persistent Systems Ltd. It is intended only for the use of
> the individual or entity to which it is addressed. If you are not the
> intended recipient, you are not authorized to read, retain, copy, print,
> distribute or use this message. If you have received this communication in
> error, please notify the sender and delete all copies of this message.
> Persistent Systems Ltd. does not accept any liability for virus infected
> mails.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

RE: Using HashMap in selectbox

Posted by Rakeshkumar Parmar <ra...@persistent.co.in>.
I think it requires list. So you can get values from hashmap using values() method.then apply person.name.


Regards,
Rakesh

-----Original Message-----
From: Shrinivas Parashar [mailto:Shrinivas_Parashar@symantec.com] 
Sent: Wednesday, March 28, 2012 3:44 PM
To: Struts Users Mailing List
Subject: Using HashMap in selectbox

Hi,
How can use a hashMap in select box with Map key as listkey and Map values one of the property as listValue.
For example I have a Map of type <String,Person> . In the listValue I want to provide person.name. Is this possible?

Regards,
Shrinivas

DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.

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