I’m new to Dash and would like to understand how to build a dynamic list of options to the dropdown input, the list of options builds on as more input are entered. From the documentation, I think intermediate values are recommended. But it results in a callback output depends on the same input, for example, outputlist = inputlist.append(‘C’). When I tried the following:
@app.callback(Output('new-watchlist', 'children'),
[Input('add-button', 'n_clicks'),
Input('new-watchlist', 'children')],
[State('ticker-input', 'value')]
)
def stock_pick(n_clicks, ticker,watchList):
if ticker is not None:
watchList.append(ticker)
print(watchList)
return watchList
I got error loading the page. Same error happens even if I setup multiple intermediate values. Help is appreciated! Thanks in advance.