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

Need to use same component as (input and output in the same callback) or (output in several callbacks)

Hi all, I am making a dashboard that contains many different radio buttons and dropdown to parametrize a model. This model can receive a configuration file (yaml format) and import it when clicking an import button, which will update the fields (Dash input components and radio mainly) you can otherwise fill manually.

My problem is that it conflicts with some dynamic modifications of those fields when selecting some options of the main parameters (to make it more user-friendly and have some auto-filling). Indeed both importing the configuration (and thereby setting values in the GUI) and modifying dynamically the displayed values due to some options being selected in other components requires to use components’ value as Output in different callbacks, which in not possible.

I have read that I could put everything in a general router callback and launch method based on the event that triggered it, but then I would need some radio buttons’ value to be both input and output of that function, which is not possible neither.

Is there really nothing I can do or is there any smart way to go around this ? Thanks for your help :slight_smile:

Hi @jizu, can you share here a graph with the desired links between components, like the callback graph in the developer tools but with the behaviour you would like to have? Maybe you need to write separate callbacks for updating components which cannot update others, with the yaml file as input, and then one or several callbacks with this routing mechanism you are mentioning. But to help you finding the right way to dispatch your components to callbacks the graph would really help :-). (please try to make it as simple as possible, ie if you have two components which have exactly the same behaviour just remove one of them to simplify the graph).