Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Struts and the fly likes struts2.0 DoubleSelect condition Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts2.0 DoubleSelect condition" Watch "struts2.0 DoubleSelect condition" New topic
Author

struts2.0 DoubleSelect condition

sankar singh
Ranch Hand

Joined: Aug 17, 2007
Posts: 40
<s:form>
<s oubleselect label="Select Item"
headerValue="--- Please Select ---"
headerKey="1" list="{'Color','Fruits'}"
doubleName="dishes"
doubleList="top == 'Color' ? {'Black','Green','White',
'Yellow','Red','Pink'} : { 'Apple','Banana','Grapes','Mango'}" />
</s:form>


How to write the duoubleList condition for the following scenario

there are two Lists, Country, State

when Country1 is choosing then doubleList (second) choice has to show States of country1
when Country2 is choosing then doubleList (second) choice has to show States of country2

if it is only two option we can use ternary option but it depends on List1 length.. then how to write in struts 2
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: struts2.0 DoubleSelect condition