This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

doubleselct in struts

 
dips pandey
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the example given
<s:doubleselect label="doubleselect test1" name="menu" list="{'fruit','other'}" doubleName="dishes" doubleList="top == 'fruit' ? {'apple', 'orange'} : {'monkey', 'chicken'}" />

has only two values in the first list that is fruit and other what if i have 10 items in the first list how should i write the
doubleList="top == 'fruit' ? {'apple', 'orange'} : {'monkey', 'chicken'}" />
part for that example..

and if a value is selected from the second list another combo box or a text box should be displayed according to the value selected.
PLEASE HELP..
 
Rajkumar Kathiresan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to construct your logic based on ternary operator. It will be more complicated when the first list size increase. Still I provide a solution for your problem.



but the other way to use the doubleselect (its called OGNL method)

But very simple way is


Create a optionMap as a LinkedHashMap (because it have sorted order) in your action and use it.


Hope its solve your problem. Let me know if you need any clarification.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!