Figured it out in case anyone has this same issue. Added a value
attribute, and used OGNL to grab a list of id's from List<Group> instead
of just the List<Group> which works just fine in a select where
multiple="true".

<s:select label="group" multiple="true" size="4" name="user.groups"
                value="user.groups.{id}" list='groupList' listKey="id"
                listValue="name" />

-Good luck 

-----Original Message-----
From: Stanley, Eric [mailto:eric.r.stan...@qwest.com] 
Sent: Tuesday, March 17, 2009 11:32 AM
To: Struts Users Mailing List
Subject: Multiple select

All,
    I cannot get my select to preselect items from groupList using
user.groups. This is my select: 

<s:select label="group" multiple="true" size="4" name="user.groups"
list='groupList' listKey="id" listValue="name" />

This is the actual contents of groupList, and user.groups. Both
collections are List<Group>.

groupList: bmg 1

groupList: wholesale 2

groupList: repair 3

groupList: ebiz 4

groupList: actuate 5

 

user.getGroups(): bmg 1

user.getGroups(): wholesale 2

I am using struts 2 version 2.0.14. Any help would be appreciated.
Please let me know if I can provide more info. Thanks.

E. Ryan Stanley
Phone: 720.578.3703
Pager: 801.482.0172
<mailto:exst...@qwest.com>  
 


This communication is the property of Qwest and may contain confidential
or privileged information. Unauthorized use of this communication is
strictly prohibited and may be unlawful.  If you have received this
communication in error, please immediately notify the sender by reply
e-mail and destroy all copies of the communication and any attachments.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to