This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Struts and the fly likes blank combobox, what's missing? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "blank combobox, what Watch "blank combobox, what New topic

blank combobox, what's missing?

Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
I'm newbie to struts so I hope O can state the question clearly.

so...I would like to have a combobox with items on my form (say categories)

in my I wrote:

ArrayList categories = new ArrayList();
categories.add("Easy Listening");
categories.add("Heavy Metal");
categories.add("New Age");
categories.add("R & B");

In my struts-config.xml i wrote:

<plug-in className="" />
//I checked it and it works (the categories is populated by the code above)
and in the form I have:

<form-property name="categories" type="java.util.ArrayList" />

In the jsp page I wrote:

<td align="left">
<html:select property="category">
<html ptions
property="categories" />
<html:errors property="category" />

so, once the jsp is up and running...I don't see the items - it's a blank combobox - anyone???

Thank you
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864

<htmlptions property="category" />


<htmlptions collection="category" />

For more information on how to use these tags, refer to:
[ February 06, 2006: Message edited by: Merrill Higginson ]

Consultant, Sima Solutions
wood burning stoves
subject: blank combobox, what's missing?
It's not a secret anymore!