File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "List of Lists &lt;html:select&gt;" Watch "List of Lists &lt;html:select&gt;" New topic
Author

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

andrew low
Greenhorn

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.


Cheers
Andrew


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}" />
</c:forEach>
</html:select>
</c:forEach>

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

Many thanks

Andrew


[ 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;