Black Lives Matter. Please consider donating to Black Girls Code today.

Multiple 'component+property' callbacks

What I intend to do:
I have bunch of radio buttons that callback dcc.Graph component based on radio button value, while a html.Button when clicked outputs dcc.Checklist component which is based on radio button’s value. Now when user chooses some other radio button, I want to hide the dcc.Checklist component because the value of radio button is changed.

What is actually happening:
Checklist won’t hide when another radio button is clicked and keeps displaying previous radio button value’s corresponding values.

What I tried:
Tried having 2 functions that callback dcc.Checklist component with style property but I get this error --> Multi output …cities-radio.options…cities-radio.style… contains an Output object that was already assigned

Hi @preet welcome to the forum! Yes, one given property of a component can only be an output in a single callback. What you can do though is to group your Inputs in one big callback and to do something different depending on which input was triggered, which you can test with dash.callback_context (take a look at https://dash.plot.ly/faqs, question How do I determine which Input has changed?).

1 Like

Thank you! Your solution worked.

1 Like

@Emmanuelle I was curious to know what is the reason for this constraint of one property being an output only in one callback ?