Hey guys,
I am trying to update the content of my div after a button has been pressed.
@app.callback(
Output("industry-view", "children"),
[
Input({"type": "industry-filter", "index": MATCH}, "n_clicks"),
State({"type": "industry-filter", "index": MATCH}, "value"),
],
prevent_initial_call=True,
)
def filter_industry_cards(n_clicks, value):
if n_clicks == 0:
raise PreventUpdate
print("callback fired")
print("industry value", value)
return value
Currently this throws an error, complaining my Input/State wild cards are not in my Output.
However, when I change my Pattern match to be “All” - this works without any issues, but this isn’t my desired functionality.
Basically, I have a div with an id of “industry-view”, by default this will render some card elements on the page, each card element has a button. Clicking one of the card elements will update the children of “industry-view”
As mentioned before, the callback runs fine when I change the match to “ALL” but it gives me the values of all the buttons, and I would just like the value of the button that is clicked.
Could anyone help me with this?