For my sample, I have a table that contains items (generic) with a location Id. The HR schema has a table of Departments that can be filtered based on this locationId.
So the final running app looks like this.
And yes the departments are filtered based on the locaitonId. So now for the code.
A question was raised about how to refresh the list incase there was any dynamic change, the answer to that is to decrease the scope of the bean which holds our map.
retrieveDepartmentListFromDatasource(locationId) calls a webService to return a list of available departments.