Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with struts2 drop down

 
M Kethi
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • 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. ..

 
Joe Ess
Bartender
Posts: 9312
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
I tried that ...it dint work out ...
 
Joe Ess
Bartender
Posts: 9312
10
Linux Mac OS X Windows
 
M Kethi
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • 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 ..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic