• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doubleselct in struts

 
dips pandey
Greenhorn
Posts: 4
  • 0
  • 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
  • 0
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic