Problem/Motivation

Once #2787255: Provide a views filter for administrative areas lands, we'll have a views filter for administrative areas that conditionally appears (with the right options) once a country has been selected. If the country is coming from another exposed filter on the same view, it'd be nice to automatically rebuild the form element for administrative areas as soon as the country selector is touched (like the address field widget), not just when the "apply" button is submitted and the whole page is reloaded.

Proposed resolution

Use #ajax to rebuild the form element.

Remaining tasks

  1. Fix Views upstream to support #ajax inside exposed filter forms: #2842525: Ajax attached to Views exposed filter form does not trigger callbacks
  2. Use the solution from #2842525 to get this working inside the AdministrativeArea views filter plugin class (hopefully reusing much of the code that's already rebuilding the filter configuration form via AJAX).

User interface changes

Enhance the exposed filter UI to automatically update the administrative area filter whenever the country filter is changed.

API changes

Hopefully none, once the dust settles upstream in Views.

Data model changes

None.

Comments

dww created an issue. See original summary.

dww’s picture

The upstream Views issue is now split, with #2842525: Ajax attached to Views exposed filter form does not trigger callbacks being the issue for fixing this in D8 core. Updating the related issues and issue summary accordingly.

hodba’s picture

Hi, any update on this issue?

dww’s picture

@hodba: Not until the upstream bug in core is fixed. Please follow #2842525: Ajax attached to Views exposed filter form does not trigger callbacks (and ideally, contribute to fixing it).

Thanks/sorry,
-Derek