wood burning stoves 2.0*
The moose likes Struts and the fly likes List of Lists <html:select> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "List of Lists &lt;html:select&gt;" Watch "List of Lists &lt;html:select&gt;" New topic

List of Lists &lt;html:select&gt;

andrew low

Joined: Mar 22, 2005
Posts: 18
I am preparing a list of lists - that is to say a list of distinct categories that need to be displayed individually in separate selects, but should populate a single list of values. So in psudeo code I've got a data structure like this

List a = new List();
a.add(new List());
a.add(new List());
a.add(new List());
a.add(new List());
a.add(new List());

how do I get to these itesm to display them with an <html:select>. I am adding them to the session as 'codes'. I can get them back and eumerate through them normally (<% type stuff %> but can't seem to get them to display as codes[0] etc.


I think I solved this

<c:forEach items="${codes}" var="x">
<html:select name="cw" property="destinationCandidate.codes" multiple="true" size="10">
<c:forEach items="${x}" var="y">
<html ption key="${y.id}" value="${y.value}" />

Is this looking right - can I have multiple selects with the same name and property?

Many thanks


[ May 24, 2005: Message edited by: andrew low ]
[ May 24, 2005: Message edited by: andrew low ]
I agree. Here's the link: http://aspose.com/file-tools
subject: List of Lists &lt;html:select&gt;
Similar Threads
Combo box internationalization
DynaActionForm and "No getter method for property"
Nested hashmap tags for dynamic pulldowns
listbox problem - seems simple, but..
How to use html:optionCollection inside a c:forEach