My task is to populate another select list based on what is choosen from one select list, querying populating data from database.
I think it goes something like:
- User clicks the parent selectlist which returns the id of the selected item.
- On select list
onChangemethod a query likeselect id, description from table where child_id=_id_is executed. - Child select list is populated based on that query. Maybe the result of query is returned in a controller method?
My problem is that I don’t seem to find an example that would suit Spring 3 applications. There are multiple examples with php, and I’m newbie with JQuery.
I would like to recommend you to use Google, because simple search will provide you the answer.
This code sample will show you the way how to do it:
Now the Server side: