From: "Eric C. Hein" <[EMAIL PROTECTED]>
...it looks like the list is being pulled from the map like I want it to, but instead of the actual list being used as collection to iterate, the tag lib is calling toString() on the list, and looking for a bean under that name.

Okay, I gave up and read the documentation ( http://struts.apache.org/userGuide/struts-html.html#options ) which says that 'collection' is the "Name of the JSP bean (in some scope) which is itself a Collection of other beans." Instead of having collection evaluate to the actual List, it needs to be the _name_ of the List.

I went back and looked at my projects, and sure enough, I have no expressions in the 'collection' attribute. Unfortunately, if your List is inside a Map, it doesn't really have a name. You can use <c:set> to name it. (And this time, I tested the code. Sorry for the earlier incorrect example!)

   <c:set var="salesList" value="${departmentMap.sales}" />
   <html-el:select name="userForm" property="employee">
<html-el:options collection="salesList" property="label" labelProperty="value"/>
   </html-el:select>

Here's the entire example page:
http://wiki.wendysmoak.com/cgi-bin/wiki.pl?StrutsOptionsFromMap

--
Wendy Smoak


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

Reply via email to