diff --git a/vizro-core/src/vizro/actions/_action_loop/_build_action_loop_callbacks.py b/vizro-core/src/vizro/actions/_action_loop/_build_action_loop_callbacks.py index b462156db..23be06049 100644 --- a/vizro-core/src/vizro/actions/_action_loop/_build_action_loop_callbacks.py +++ b/vizro-core/src/vizro/actions/_action_loop/_build_action_loop_callbacks.py @@ -10,7 +10,6 @@ ) from vizro.managers import model_manager from vizro.managers._model_manager import ModelID -from vizro.models import Table logger = logging.getLogger(__name__) @@ -25,11 +24,12 @@ def _build_action_loop_callbacks() -> None: gateway_inputs: List[Input] = [] for actions_chain in actions_chains: + # Recalculating the trigger component id to use the underlying callable object as a trigger component if needed. actions_chain_trigger_component_id = actions_chain.trigger.component_id try: actions_chain_trigger_component = model_manager[ModelID(str(actions_chain_trigger_component_id))] - # Use underlying table object as a trigger component. - if isinstance(actions_chain_trigger_component, Table): + # Use underlying callable object as a trigger component. + if hasattr(actions_chain_trigger_component, "_callable_object_id"): actions_chain_trigger_component_id = actions_chain_trigger_component._callable_object_id # Not all action_chain_trigger_components are included in model_manager e.g. on_page_load_action_trigger except KeyError: diff --git a/vizro-core/src/vizro/actions/_actions_utils.py b/vizro-core/src/vizro/actions/_actions_utils.py index 7356cbd2e..6f52b4d2c 100644 --- a/vizro-core/src/vizro/actions/_actions_utils.py +++ b/vizro-core/src/vizro/actions/_actions_utils.py @@ -105,6 +105,7 @@ def _apply_table_filter_interaction( if not ctd_active_cell["value"] or not ctd_derived_viewport_data["value"]: return data_frame + # ctd_active_cell["id"] represents the underlying table id, so we need to fetch its parent Vizro Table actions. source_table_actions = _get_component_actions(_get_parent_vizro_table(ctd_active_cell["id"])) for action in source_table_actions: