You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ted Husted <hu...@apache.org> on 2002/03/19 18:04:43 UTC

Re: How can I used html:select with a Collection of String

People often have trouble using Vectors with the Struts tags. They are
really designed to work best with the new Collection objects or with
simple arrays. My best advice would be to have a property like 

Object[] getCollection() {
  return vector.toArray()
}

But if you search the mail-archives, there have been several threads
about this. 

http://www.mail-archive.com/struts-user%40jakarta.apache.org/

If you come up with a good answer, I'll put in the newbie FAQ we're
constructing.

http://jakarta.apache.org/struts/newbie.html

-- Ted Husted, Husted dot Com, Fairport NY US
-- Developing Java Web Applications with Struts
-- Tel: +1 585 737-3463
-- Web: http://husted.com/about/services


"Aroui, Dr. Djelloul" wrote:
> 
> myCollection is a Vector of Integer. I dont need property or labelProperty.
> How can I use the select with a Collection.
> 
> <html:select property="id">
> <html:options collection="myCollection"/>
> </html:select>
> 
> please any help
> 
> thanks
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>