• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem with struts2 drop down

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have a map of type ..
HashMap<String, List<String>>();

key - id1
value - List of value1,value2,value3

key - id2
value - List of value3,value4,value5

I am not sure how to represent them on two drop downs.

first drop should show id1, id2
second drop down should show value1, value2, values3 or value3,value4,value5
depending on what was selected on first drop down..

I am successful to some extent using map.entrySet as the list..

first drop down key
second drop down as value ..

but thats not the exact way i want ..cos on second drop down it shows values as lists [value1, value2, values3 ] [value3,value4,value5] .

any suggestions please ..i wasted almost a day ..already. ..

 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have a look at the doubleselect tag:

Renders two HTML select elements with second one changing displayed values depending on selected entry of first one.

 
M Kethi
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried that ...it dint work out ...
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ItDoesntWorkIsUseless
 
M Kethi
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay ..

I had the same problem with double select as i did with select ..
i need to find a way to populate the second dropdown with values of the arraylist ( value of the map)
not sure how I can accomplish ..
 
Note to self: don't get into a fist fight with a cactus. Command this tiny ad to do it:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic