Is it possible to give inputs to a callback function which is inside another callback? In the below example I need to process each of the dict_item['Name'] which is getting passed from the outer call back function in a for loop.
# Outer Call back
@app.callback(dash.dependencies.Output('dummydiv','children'), # Dummy Output
[dash.dependencies.Input('interval1', 'n_intervals')], # Interal Triger
[dash.dependencies.Input("table", "data")]) # dcc.Store which stores values
def use_table(n, data):
print(type(data))
print("Outer Called")
if data:
for dict_item in data:
@app.callback(dash.dependencies.Output('lable1','children'), #Output to print the values in a llop
dash.dependencies.Input(dict_item['Name'])
)
def printing(s_name):
sn = s_name
print(sn)
return sn # Return "Name to Print" to id "Lable1"
return "" #Dummy String - Print Nothing to id "dummydiv"
return dash.no_update
Unfortunately, I am not able to pass the input parameter to the inner call back function. It returns the below error.
oh, I am very sorry for not explaining it clearly.
lable1 is just an header component. Like this html.H1(id='label1', children='').
I have a table which stores certain data, in which one of the columns is Name. I just want to loop through the data store and show the names in the output component having id lable1. Of course this repeats after certain interval of time hence using the Input component interval1.
But you want to display all the names that exist in the rows of the dict_item[‘Name’] to lable1, or do you want to display one name row each time the interval1 change?
It’s not clear the information you want to show to the user.
I do not want to display all the names that exist in the rows of the table at once or as a list, instead I need to display one name at a time. Assume that that column “Name” consists of 5 names, So after say 1 minute I need to loop through and display each of the 5 names(Display only one name at a given time).