☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Two CustomJS callbacks, can't trigger one from the other

Community Support
Sarah_Bird5
Sarah_Bird5

I have a select with a callback. Something like this:

callback = CustomJS(args=(dict(source=source)), code=code)
select = Select(options=options, callback=callback)

``

It works correctly - on changing select, my plot updates as expected.

I have another callback on a button:

button_code = """
    // do some stuff
    select.value = newValue;
    select.change.emit();

"""

button_callback = CustomJS(args=dict(select=select, source=source), code=button_code)
button = Button(label="button", callback=button_callback)

``

When I press the button, the value of the select button updates as expected. However, the select CustomJS does not execute and my plot does not update as expected.

Does anyone have any ideas?

Many thanks in advance for your help.

⌁   Link to post
Sarah_Bird5
Sarah_Bird5

(I should add the select.change.emit() is not necessary to get the value of my select to change - it was just some thing I tried to kick the CustomJS.

···

On Saturday, August 25, 2018 at 1:39:00 PM UTC-5, Sarah Bird wrote:

I have a select with a callback. Something like this:

callback = CustomJS(args=(dict(source=source)), code=code)
select = Select(options=options, callback=callback)

``

It works correctly - on changing select, my plot updates as expected.

I have another callback on a button:

button_code = """
    // do some stuff
    select.value = newValue;
    select.change.emit();

"""

button_callback = CustomJS(args=dict(select=select, source=source), code=button_code)
button = Button(label="button", callback=button_callback)

``

When I press the button, the value of the select button updates as expected. However, the select CustomJS does not execute and my plot does not update as expected.

Does anyone have any ideas?

Many thanks in advance for your help.

⌁   Link to post

End of archived discussion · Replies are disabled