struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mlevin <marshall_le...@harvard.edu>
Subject Getting OPTGROUP items to appear in the right order within a larger top-level SELECT list
Date Thu, 02 Jul 2009 17:41:28 GMT

** Many apologies if this goes through twice -- I posted a few hours ago and
didn't see my own post show up yet **

Hi folks,
 
I'm having some trouble getting my SELECT menu to appear the way I want it
in a new Struts 2 project.
 
What I want is something like this:
 
Apple
Banana
Cookies
     Chocolate Chip
     Oatmeal
     Peanut Butter
Drinks
     Coke
     Sprite
Falafel
Gumdrops
 
In my code I have something like this:
 
<s:select name="choices" list="topLevelList" size="11" multiple="true">
     <s:optgroup label="Cookies" list="cookieList"/>
     <s:optgroup label="Drinks" list="drinkList"/>
</s:select>
 
topLevelList contains Apple, Banana, Falafel, Gumdrops
cookieList contains Chocolate Chip, Oatmeal, Peanut Butter
drinkList contains Coke, Sprite
 
But Struts is putting the OPTGROUP items at the end, so the list comes out
like:
 
Apple
Banana
Falafel
Gumdrops
Cookies
     Chocolate Chip
     Oatmeal
     Peanut Butter
Drinks
     Coke
     Sprite
 
How can I get it to put the OPTGROUP things in the middle so I can keep my
list in the order I want? I want to intersperse some OPTGROUP choices within
a larger list of top-level choices.
 
Is there any way to do this?
 
Thanks!
-- 
View this message in context: http://www.nabble.com/Getting-OPTGROUP-items-to-appear-in-the-right-order-within-a-larger-top-level-SELECT-list-tp24311086p24311086.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Mime
View raw message