dash
dash copied to clipboard
dash-testing, mocking callback context, keys and multiple context data
Dear all,
I have a callback with a dynamic set of inputs.
I thus use ctx.inputs
or ctx.inputs_list
to capture which elements are available.
In the dash-testing
documentation, it is well explained how the triggered
context can be generated using context_value.set
.
However, I run into the following issue:
It is not clear to me how the dictionary keys provided to context_value.set
map to those of dash.callback_context
.
It seems that what is shown in the example, the key triggered_inputs
affects all of the ctx.triggered
, ctx.triggered_prop_ids
, ctx.triggered_id
attributes.
- How can I set
ctx.inputs
andctx.inputs_list
and their equivalents forstates
accordingly usingcontext_value.set
? - Is this currently possible?
- In addition, is it possible to provide multiple attributes at once to
context_value.set
to for example set bothtriggered
andstates_list
attributes?