Since you mentioned the “Reset” button, I assume you have seen this discussion, which uses the following callback:
@app.callback(Output('input_button','n_clicks'),
[Input('reset_button','n_clicks')])
def update(reset):
return 0
now, since you don’t want a “Reset Button”, can you make the input to the callback one, or all, of (“the button click or by tab clicks or by slider [click]”) — i.e. the components that trigger the page reload? These components may update other Outputs, but you should be able to simultaneously update the DCC n_clicks
value, or the html.Input
value, using the multiple outputs feature.
This would look something like this:
# reset
@app.callback([Output('show_button','n_clicks'),
Output('text_input','value'),
Output('my_op_result','value')],
[Input('my_reload_button','n_clicks'),
Input('my_reload_tab','value'),
Input('my_reload_slider','value')])
def update(no_clicks, value1, value2):
my_result = do_my_op()
return 0, '', my_result