Short version: How, using JavaScript or JQuery, do I dynamically reassign the selected value of a dynamically generated multiselector box to a default value given certain conditions are met on the change (user select) in another?
Long version:
I have three levels of multiselectors (State, Metro Area (aka MSA), County) dynamically dependent on each other, so that only counties and metro areas intersecting the chosen states are displayed in the respective selectors.
My problem is that if I select an MSA within, say, Maryland and then click on Texas, my table that the multiselectors filter (a parameterized MDX query) crashes.
Going by the error logs in Pentaho's catalina.out, it appears that the MSA (Metro Area) selector parameter becomes undefined when a state that does not contain the previously selected MSA is chosen.
I would like to make it so that when a new state or group of states is selected that does not include the currently selected MSA or County, those selectors revert to the default ("All") value. I'm a JQuery and JavaScript newby, so I need as much detail as possible, while still being considerate of your time.
Additional details, if needed:
The values in the MSA (Metro Area) selector change depending on the state(s) that are selected, and the County selector is dependent on State and Metro Area. This is all happening on an HTML page (generated by Pentaho's CDE Dashboard). The datasource for each is a parameterized SQL query (carried out by Pentaho).
When the "All" option for county and MSA is selected I can safely change the state selection:
When something other than the "All" option for county and MSA is selected I cannot change change the state selection without the dashboard crashing:
Data coming from SQL is a two-column array, with an MDX-formatted value and a clear-text label, with an All Value to specify the MDX parent 'All' value.