I added a button to my layout. When I try to write a callback for it, I get the following error:
dash.exceptions.NonExistantEventException:
Attempting to assign a callback with
the event "click" but the component
"get_custom_vndr" doesn't have "click" as an event.
Here is a list of the available events in "get_custom_vndr":
[]
Here's how I'm adding it to my layout:
app_vndr.layout = html.Div([
html.Button(
'+',
id='get_custom_vndr',
type='submit'
)
])
and here's the callback function that's giving the above error:
@app_vndr.callback(
dash.dependencies.Output('overlay', 'className'),
events=[dash.dependencies.Event('get_custom_vndr', 'click'),
dash.dependencies.Event('add_vndr_id_submit', 'click')])
def show_input(b1_n, b2_n):
if b1_n>0:
return ''
elif b1_n>0:
return 'hidden'
Did I miss something when I added the button to my layout? or when I tried to write the callback?
I got it working for
dash.dependencies.Input('get_custom_vndr', 'n_clicks')
but I'd like to use two buttons for the same output and with the n_clicks event, I'd need to try to figure out which button was clicked by comparing the current n_clicks to the previous n_clicks for each button, which seems like a pretty hacky way to do it.