struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Skip Hollowell <>
Subject Re: {S2}doublselect How to create the doubleList
Date Tue, 25 Sep 2007 12:33:12 GMT
I think I have it...and I wanted to make sure I got this archived 
somewhere in case I or anyone else was ever looking for an example.

The first list is a list of Course objects, made up of an id, name and 
Foods (a Set of Food objects)
Food has an id and a name field.

List<Course> listCourse = new ArrayList<Course>();  // make sure you 
have a getter for this

Course c1 = new Course(1, "Appetizer");
Food f1 = new Food("1", "Cheese Stick");
Food f2 = new Food("2", "Nachos");
Set<Food> setFood1 = new HashSet<Food>();

Course c2 = new Course(2, "Main Course");
Food f1 = new Food("3", "Chicken Sandwich");
Food f2 = new Food("4", "Veggie Wrap");
Set<Food> setFood2 = new HashSet<Food>();

etc etc ad nauseum

and in the JSP then:
<s:doubleselect label="Meal"
name="course" list="listCourse" listKey="id" listValue="name"
doubleName="food" doubleList="foods"
doubleListKey="id" doubleListValue="name" />

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message