HashMap with options

2003-10-10 Thread Manav Gupta
Hi
 
Can i use HashMap with options?
 
something like:
 


 
such that the option value is the key and the labelProperty is the value?
 
thanks
M


Re: HashMap with options

2003-10-10 Thread Sgarlata Matt
You might want to investigate using a List of LabelValueBean objects
instead.

Matt
- Original Message - 
From: "Manav Gupta" <[EMAIL PROTECTED]>
To: "Struts Developers (E-mail)" <[EMAIL PROTECTED]>
Sent: Friday, October 10, 2003 12:24 PM
Subject: HashMap with options


> Hi
>
> Can i use HashMap with options?
>
> something like:
>
>  type="java.util.HashMap" />
>  labelProperty="value"/>
>
> such that the option value is the key and the labelProperty is the value?
>
> thanks
> M
>


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



Re: HashMap with options

2003-10-10 Thread Michael D. Norman
> Manav wrote:
>
> Can i use HashMap with options?
>
> something like:
>
>  type="java.util.HashMap" />
>  labelProperty="value"/>

Manav,

Yes, you should be able to use any Map as the collection, with the
attributes you have defined above for .  However, your
 needs a name attribute if you're going to use the property
attribute.

-- Michael D. Norman
   ProbuSoft - Custom Software Development
   http://www.probusoft.com/
   913-390-6951
   [EMAIL PROTECTED]



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



RE: HashMap with options

2003-10-13 Thread Manav Gupta
Hi Michael,

Thanks for your reply - I'll definitely give it a go!

Could you elaborate what happens when I specify the name along with the
property attribute? Does struts iterate through each item in the Map,
calling get("key") and get("value") on each item in the Map? Is there any
link/website where I can read more about this?

Many Thanks
M

> -Original Message-
> From: Michael D. Norman [mailto:[EMAIL PROTECTED]
> Sent: Saturday, October 11, 2003 3:31 AM
> To: Struts Users Mailing List
> Subject: Re: HashMap with options
> 
> 
> > Manav wrote:
> >
> > Can i use HashMap with options?
> >
> > something like:
> >
> >  > type="java.util.HashMap" />
> >  > labelProperty="value"/>
> 
> Manav,
> 
> Yes, you should be able to use any Map as the collection, with the
> attributes you have defined above for .  
> However, your
>  needs a name attribute if you're going to 
> use the property
> attribute.
> 
> -- Michael D. Norman
>ProbuSoft - Custom Software Development
>http://www.probusoft.com/
>913-390-6951
>[EMAIL PROTECTED]
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> _
> This e-mail has been scanned for viruses by MCI's Internet 
> Managed Scanning Services - powered by MessageLabs. For 
> further information visit http://www.mci.com
> 

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



RE: HashMap with options

2003-10-13 Thread Michael D. Norman
> Could you elaborate what happens when I specify the name along with
the
> property attribute? 

The "name" attribute tells the  tag what key to use in the
page/request/session/application scope.  Without it, you're trying to
get a property from nothing.

> Does struts iterate through each item in the Map,
> calling get("key") and get("value") on each item in the Map?

The  tag iterates over the Map's entrySet().  It then
calls getKey() and getValue() on each Map.Entry for the options.

> Is there any link/website where I can read more about this?

I honestly don't know.  I usually just read the source.





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



RE: HashMap with options

2003-10-14 Thread Manav Gupta
Thanks Michael, you've been a great help... 

Regards,
m

> -Original Message-
> From: Michael D. Norman [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 14, 2003 6:37 AM
> To: 'Struts Users Mailing List'
> Subject: RE: HashMap with options
> 
> 
> > Could you elaborate what happens when I specify the name along with
> the
> > property attribute? 
> 
> The "name" attribute tells the  tag what key to 
> use in the
> page/request/session/application scope.  Without it, you're trying to
> get a property from nothing.
> 
> > Does struts iterate through each item in the Map,
> > calling get("key") and get("value") on each item in the Map?
> 
> The  tag iterates over the Map's entrySet().  It then
> calls getKey() and getValue() on each Map.Entry for the options.
> 
> > Is there any link/website where I can read more about this?
> 
> I honestly don't know.  I usually just read the source.
> 
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> _
> This e-mail has been scanned for viruses by MCI's Internet 
> Managed Scanning Services - powered by MessageLabs. For 
> further information visit http://www.mci.com
> 

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