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

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.

(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.