Widget Updating

Need some hints on how to update select widget values from other widget callbacks. I have 2 select widgets. Select widget A’s callback modifies select widgets B’s options list, which changes select widget B’s displayed value. How do I update select widget B’s value to the updated display value without having to physically select it. I would expect something like B_select.update, but that doesn’t work.
-rick

Have you tried

widget.options = [new, options, here]

···

On 8/5/16 9:17 AM, rick wrote:

    Need some hints on how to update select widget

values from other widget callbacks. I have 2 select widgets.
Select widget A’s callback modifies select widgets B’s options
list, which changes select widget B’s displayed value. How do I
update select widget B’s value to the updated display value
without having to physically select it. I would expect something
like B_select.update, but that doesn’t work.
-rick

  You received this message because you are subscribed to the Google

Groups “Bokeh Discussion - Public” group.

  To unsubscribe from this group and stop receiving emails from it,

send an email to [email protected].

  To post to this group, send email to [email protected]

  To view this discussion on the web visit [https://groups.google.com/a/continuum.io/d/msgid/bokeh/758462a3-08d7-4e57-9202-018033088414%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/758462a3-08d7-4e57-9202-018033088414%40continuum.io?utm_medium=email&utm_source=footer).

  For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).


Sarah Bird
Developer, Bokeh

    [
      ![Continuum Analytics](http://docs.continuum.io/_static/img/ContinuumWordmark.png)
    ](http://continuum.io)

I can successfully update the options. My issue is with the value from the initial load that still remains, even though the widgets options have changed visually and inside the argument. Just trying to update that value inside another widgets callback.

···

On Friday, August 5, 2016 at 11:49:27 AM UTC-5, Sarah Bird wrote:

Have you tried

widget.options = [new, options, here]

On 8/5/16 9:17 AM, rick wrote:

    Need some hints on how to update select widget

values from other widget callbacks. I have 2 select widgets.
Select widget A’s callback modifies select widgets B’s options
list, which changes select widget B’s displayed value. How do I
update select widget B’s value to the updated display value
without having to physically select it. I would expect something
like B_select.update, but that doesn’t work.
-rick

  You received this message because you are subscribed to the Google

Groups “Bokeh Discussion - Public” group.

  To unsubscribe from this group and stop receiving emails from it,

send an email to [email protected].

  To post to this group, send email to [email protected]

  To view this discussion on the web visit [https://groups.google.com/a/continuum.io/d/msgid/bokeh/758462a3-08d7-4e57-9202-018033088414%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/758462a3-08d7-4e57-9202-018033088414%40continuum.io?utm_medium=email&utm_source=footer).

  For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).


Sarah Bird
Developer, Bokeh

    [
      <img alt="Continuum Analytics" src="https://lh6.googleusercontent.com/proxy/VYgVjggTk1hCXSN9wFkffE3I6kxTvJ51tT4KvDXOuKbs1WyFG66k7kt2-vkDimbyxfWtP-d1paJmstMYhPPnDYSUF4rLPoYM2GM2QFM=w5000-h5000" style="width:150px;min-height:30px" height="30px" width="150px">
    ](http://continuum.io)

For reference:

def update_B(attrname, old, new):

“”"callback A

“”"

Avalue = A_select.value

#new option selecting stuff here

#Aselectedvalue = 2

#Bnewoptionslist = 2.1, 2.2, 2.3

B_select.options=Bnewoptionslist

#How to update to widgets displayed value from newoptions set

B_select.update(‘value’ = new displayed value)

def update_Plot():

Aval = A_select.value

Bval = B_select.value

#source update stuff

#initialize

A_select = Select(value=‘1’, title=‘Set’, options=[‘1’,‘2’,‘3’])

B_select = Select(value=‘1.1’, title=‘Subset’, options=[‘1.1’,‘1.2’,‘1.3’])

X_button = Button(label=‘Update’)

#callbacks

A_select.on_change(‘value’, update_B)

X_button.on_click(update_Plot)

···

On Friday, August 5, 2016 at 11:49:27 AM UTC-5, Sarah Bird wrote:

Have you tried

widget.options = [new, options, here]

On 8/5/16 9:17 AM, rick wrote:

    Need some hints on how to update select widget

values from other widget callbacks. I have 2 select widgets.
Select widget A’s callback modifies select widgets B’s options
list, which changes select widget B’s displayed value. How do I
update select widget B’s value to the updated display value
without having to physically select it. I would expect something
like B_select.update, but that doesn’t work.
-rick

  You received this message because you are subscribed to the Google

Groups “Bokeh Discussion - Public” group.

  To unsubscribe from this group and stop receiving emails from it,

send an email to [email protected].

  To post to this group, send email to [email protected]

  To view this discussion on the web visit [https://groups.google.com/a/continuum.io/d/msgid/bokeh/758462a3-08d7-4e57-9202-018033088414%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/758462a3-08d7-4e57-9202-018033088414%40continuum.io?utm_medium=email&utm_source=footer).

  For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).


Sarah Bird
Developer, Bokeh

    [
      <img alt="Continuum Analytics" src="https://lh6.googleusercontent.com/proxy/VYgVjggTk1hCXSN9wFkffE3I6kxTvJ51tT4KvDXOuKbs1WyFG66k7kt2-vkDimbyxfWtP-d1paJmstMYhPPnDYSUF4rLPoYM2GM2QFM=w5000-h5000" style="width:150px;min-height:30px" height="30px" width="150px">
    ](http://continuum.io)

Rick,

did you find a solution?

···

On Friday, August 5, 2016 at 1:57:03 PM UTC-4, rick wrote:

For reference:

def update_B(attrname, old, new):

“”"callback A

“”"

Avalue = A_select.value

#new option selecting stuff here

#Aselectedvalue = 2

#Bnewoptionslist = 2.1, 2.2, 2.3

B_select.options=Bnewoptionslist

#How to update to widgets displayed value from newoptions set

B_select.update(‘value’ = new displayed value)

def update_Plot():

Aval = A_select.value

Bval = B_select.value

#source update stuff

#initialize

A_select = Select(value=‘1’, title=‘Set’, options=[‘1’,‘2’,‘3’])

B_select = Select(value=‘1.1’, title=‘Subset’, options=[‘1.1’,‘1.2’,‘1.3’])

X_button = Button(label=‘Update’)

#callbacks

A_select.on_change(‘value’, update_B)

X_button.on_click(update_Plot)

On Friday, August 5, 2016 at 11:49:27 AM UTC-5, Sarah Bird wrote:

Have you tried

widget.options = [new, options, here]

On 8/5/16 9:17 AM, rick wrote:

    Need some hints on how to update select widget

values from other widget callbacks. I have 2 select widgets.
Select widget A’s callback modifies select widgets B’s options
list, which changes select widget B’s displayed value. How do I
update select widget B’s value to the updated display value
without having to physically select it. I would expect something
like B_select.update, but that doesn’t work.
-rick

  You received this message because you are subscribed to the Google

Groups “Bokeh Discussion - Public” group.

  To unsubscribe from this group and stop receiving emails from it,

send an email to [email protected].

  To post to this group, send email to [email protected]

  To view this discussion on the web visit [https://groups.google.com/a/continuum.io/d/msgid/bokeh/758462a3-08d7-4e57-9202-018033088414%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/758462a3-08d7-4e57-9202-018033088414%40continuum.io?utm_medium=email&utm_source=footer).

  For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).


Sarah Bird
Developer, Bokeh

    [
      <img width="150" height="30" style="width: 150px; min-height: 30px;" alt="Continuum Analytics" src="https://lh6.googleusercontent.com/proxy/VYgVjggTk1hCXSN9wFkffE3I6kxTvJ51tT4KvDXOuKbs1WyFG66k7kt2-vkDimbyxfWtP-d1paJmstMYhPPnDYSUF4rLPoYM2GM2QFM=w5000-h5000">
    ](http://continuum.io)

Hi.

Any solution to this issue?

···

On Wednesday, 28 December 2016 14:32:59 UTC, Bryan Hutson wrote:

Rick,

did you find a solution?

On Friday, August 5, 2016 at 1:57:03 PM UTC-4, rick wrote:

For reference:

def update_B(attrname, old, new):

“”"callback A

“”"

Avalue = A_select.value

#new option selecting stuff here

#Aselectedvalue = 2

#Bnewoptionslist = 2.1, 2.2, 2.3

B_select.options=Bnewoptionslist

#How to update to widgets displayed value from newoptions set

B_select.update(‘value’ = new displayed value)

def update_Plot():

Aval = A_select.value

Bval = B_select.value

#source update stuff

#initialize

A_select = Select(value=‘1’, title=‘Set’, options=[‘1’,‘2’,‘3’])

B_select = Select(value=‘1.1’, title=‘Subset’, options=[‘1.1’,‘1.2’,‘1.3’])

X_button = Button(label=‘Update’)

#callbacks

A_select.on_change(‘value’, update_B)

X_button.on_click(update_Plot)

On Friday, August 5, 2016 at 11:49:27 AM UTC-5, Sarah Bird wrote:

Have you tried

widget.options = [new, options, here]

On 8/5/16 9:17 AM, rick wrote:

    Need some hints on how to update select widget

values from other widget callbacks. I have 2 select widgets.
Select widget A’s callback modifies select widgets B’s options
list, which changes select widget B’s displayed value. How do I
update select widget B’s value to the updated display value
without having to physically select it. I would expect something
like B_select.update, but that doesn’t work.
-rick

  You received this message because you are subscribed to the Google

Groups “Bokeh Discussion - Public” group.

  To unsubscribe from this group and stop receiving emails from it,

send an email to [email protected].

  To post to this group, send email to [email protected]

  To view this discussion on the web visit [https://groups.google.com/a/continuum.io/d/msgid/bokeh/758462a3-08d7-4e57-9202-018033088414%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/758462a3-08d7-4e57-9202-018033088414%40continuum.io?utm_medium=email&utm_source=footer).

  For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).


Sarah Bird
Developer, Bokeh

    [
      <img style="width:150px;min-height:30px" alt="Continuum Analytics" src="https://lh6.googleusercontent.com/proxy/VYgVjggTk1hCXSN9wFkffE3I6kxTvJ51tT4KvDXOuKbs1WyFG66k7kt2-vkDimbyxfWtP-d1paJmstMYhPPnDYSUF4rLPoYM2GM2QFM=w5000-h5000" width="150" height="30">
    ](http://continuum.io)

Hi,

It’s difficult to meaningfully respond to old questions that are revived like this. I would suggest making your own new question with full information specific to your case.

Thanks,

Bryan

···

On Oct 15, 2018, at 08:21, [email protected] wrote:

Hi.

Any solution to this issue?

On Wednesday, 28 December 2016 14:32:59 UTC, Bryan Hutson wrote:

Rick,

did you find a solution?

On Friday, August 5, 2016 at 1:57:03 PM UTC-4, rick wrote:

For reference:

def update_B(attrname, old, new):

“”"callback A

“”"

Avalue = A_select.value

#new option selecting stuff here

#Aselectedvalue = 2

#Bnewoptionslist = 2.1, 2.2, 2.3

B_select.options=Bnewoptionslist

#How to update to widgets displayed value from newoptions set

B_select.update(‘value’ = new displayed value)

def update_Plot():

Aval = A_select.value

Bval = B_select.value

#source update stuff

#initialize

A_select = Select(value=‘1’, title=‘Set’, options=[‘1’,‘2’,‘3’])

B_select = Select(value=‘1.1’, title=‘Subset’, options=[‘1.1’,‘1.2’,‘1.3’])

X_button = Button(label=‘Update’)

#callbacks

A_select.on_change(‘value’, update_B)

X_button.on_click(update_Plot)

On Friday, August 5, 2016 at 11:49:27 AM UTC-5, Sarah Bird wrote:

Have you tried

widget.options = [new, options, here]

On 8/5/16 9:17 AM, rick wrote:

    Need some hints on how to update select widget

values from other widget callbacks. I have 2 select widgets.
Select widget A’s callback modifies select widgets B’s options
list, which changes select widget B’s displayed value. How do I
update select widget B’s value to the updated display value
without having to physically select it. I would expect something
like B_select.update, but that doesn’t work.
-rick

  You received this message because you are subscribed to the Google

Groups “Bokeh Discussion - Public” group.

  To unsubscribe from this group and stop receiving emails from it,

send an email to [email protected].

  To post to this group, send email to [email protected]

  To view this discussion on the web visit [https://groups.google.com/a/continuum.io/d/msgid/bokeh/758462a3-08d7-4e57-9202-018033088414%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/758462a3-08d7-4e57-9202-018033088414%40continuum.io?utm_medium=email&utm_source=footer).

  For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).


Sarah Bird
Developer, Bokeh

    [
      <img style="width:150px;min-height:30px" alt="Continuum Analytics" src="https://lh6.googleusercontent.com/proxy/VYgVjggTk1hCXSN9wFkffE3I6kxTvJ51tT4KvDXOuKbs1WyFG66k7kt2-vkDimbyxfWtP-d1paJmstMYhPPnDYSUF4rLPoYM2GM2QFM=w5000-h5000" width="150" height="30">
    ](http://continuum.io)

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/94e60c8f-738d-4e93-8850-d3933ee5a8bf%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.