aspose file tools*
The moose likes Struts and the fly likes problem with struts2 drop down Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem with struts2 drop down" Watch "problem with struts2 drop down" New topic
Author

problem with struts2 drop down

M Kethi
Greenhorn

Joined: Aug 01, 2008
Posts: 15

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

Joined: Oct 29, 2001
Posts: 8927
    
    9

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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
M Kethi
Greenhorn

Joined: Aug 01, 2008
Posts: 15
I tried that ...it dint work out ...
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8927
    
    9

ItDoesntWorkIsUseless
M Kethi
Greenhorn

Joined: Aug 01, 2008
Posts: 15
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 ..
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: problem with struts2 drop down