I am having a method to get the countryname list from the database and a method to fetch statenames for any provided countryname. But not sure how to link both for country and state.
<sx:autocompleter list="countrynames" name="employee.countryname" value="%{employee.countryname}" label="%{getText('label.countryname')}"/>
<sx:autocompleter list="statenames" name="employee.statename" value="%{employee.statename}" label="%{getText('label.statename')}"/>
I am having arraylists with name ‘countrynames’ and similarly ‘statenames’ but not sure how to get statenames dynamically generated based on the selection of a country in the above country list and how can i connect that fetched countryname to the method to call explicitly the list of states in the country.
A few suggestion i would like to give you
There is a Jquery plugin which is in active use and will provide you most of the functionality which you are looking for, have a look at A_simple_Doubleselect_with_Topics.
I am not a big admirer of this plugin as it limit us a lot in implementation though it provides us a lot of good widgets and features
my suggestion is to use following approach
Add a on-change event to your first drop down and create a function where you will fill the second drop down
Action Class