I’m trying to build an “app” with purely client-side interactions, but I’m having trouble linking a Button to a CustomJS action. When I click the button, it causes a refresh of the page, and my CustomJS is never triggered (I’ve checked with simple console.log statements). My code basically looks like this:
text_input_1 = TextInput(value="", title=“schema.tablename”)
text_input_2 = TextInput(value="", title=“x”)
text_input_3 = TextInput(value="", title=“y”)
button = Button(label=“Go”, type=“success”)
button.on_click(btn_callback)
btn_callback.args[“text_input_1”] = text_input_1
btn_callback.args[“text_input_2”] = text_input_2
btn_callback.args[“text_input_3”] = text_input_3
left = figure(…)
right = figure(…)
show(vform(text_input_1, text_input_2, text_input_3, button, gridplot([[left, right]])))
Basically I’m using text inputs to make a form, but I only want to trigger an action when the user clicks the button. btn_callback is a CustomJS. I’ve used this kind of hacky form submission with multiple text inputs successfully with sliders, but for some reason can’t get the Button to trigger the CustomJS (and not do a page reload).
Any suggestion?
Michelangelo

