return ArrayList from spring controller for ajax call and render in second dropdown

Posted by user1708125 on Stack Overflow See other posts from Stack Overflow or by user1708125
Published on 2012-09-29T19:09:46Z Indexed on 2012/09/30 21:37 UTC
Read the original article Hit count: 221

Filed under:
|
|
|

I've a spring bean with 3 Maps all of which are to be populated incrementally. First map is an item category list, second map is a product list and third map is a hobby for item type list

All the maps are mapped to and on the JSP. When the page is loaded only the first map is populated on the onchange event of first map, I need to populate the second map in the bean and similarly on the onchange event of second map, I need to populate the third map in the bean.

Is there a way to do this using Ajax??

I need some code samples to how to render JSON response in second and third dropdown.

Clarification: @Donal: I have a simple JSP page with 3 dropdowns corresponding to 3 maps stored in my commandBean. So when the page loads for the first time only the first map and hence the first dropdown is populated. Now whenever the user selects anything out of the first dropdown, I need to send the same commandbean back with the values of the first dropdown and get the values for the second map and hence the second dropdown and so forth for the 3rd dropdown as well. For each dropdown I 've got 3 maps and 3 variables for storing the selected values. Now I want to understand if this is possible using Ajax. I hope this clarifies whatever you need to know. Thanx

© Stack Overflow or respective owner

Related posts about AJAX

Related posts about JSON