☰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

How can I change the options of a Select field (bokeh serve)?

Community Support
Ivo
Ivo

Hi, it’s me again

I still struggle with the very simple parts and hardly find answers by googling.

How can I change the options of a Select field? I use bokeh serve version 0.12.

I would like to change the options of a Select field within the callback function of an other field.

I hope it’s the last question for my first project.

Thank you for your patience

Ivo

⌁   Link to post
birdsarah_continuum
birdsarah_continuum

Hi Ivo,

    Have you tried the same thing as for button.

                      As Bryan said we're working on

layout, and thi s use case is very much in
my to do list.

                  Best,

                    Bird
···

On 4/17/16 4:34 AM, Ivo wrote:

Hi, it’s me again

    I still struggle with the very simple parts and hardly find

answers by googling.

    How can I change the options of a Select field? I use bokeh

serve version 0.12.

    I would like to change the options of a Select field within the

callback function of an other field.

    I hope it's the last question for my first project.



    Thank you for your patience



    Ivo

–

  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 bokeh+unsubscribe@continuum.io.

  To post to this group, send email to bokeh@continuum.io.

  To view this discussion on the web visit [](https://groups.google.com/a/continuum.io/d/msgid/bokeh/948b5a7a-8ab1-460b-b7a6-8c34b7fc1292%40continuum.io?utm_medium=email&utm_source=footer)      .

For more options, visit .

–
Sarah Bird
Developer, Bokeh

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

https://groups.google.com/a/continuum.io/d/msgid/bokeh/948b5a7a-8ab1-460b-b7a6-8c34b7fc1292%40continuum.io
https://groups.google.com/a/continuum.io/d/optout

⌁   Link to post
Bryan
Bryan

Hi Ivo, the Select widget has an "options" property:

  http://bokeh.pydata.org/en/latest/docs/reference/models/widgets.inputs.html#bokeh.models.widgets.inputs.Select

Are you saying you have tried changing the value to a new list of options, and it has not updated?

Bryan

···

On Apr 17, 2016, at 6:34 AM, Ivo <strebelivo@gmail.com> wrote:

Hi, it's me again

I still struggle with the very simple parts and hardly find answers by googling.

How can I change the options of a Select field? I use bokeh serve version 0.12.

I would like to change the options of a Select field within the callback function of an other field.

I hope it's the last question for my first project.

Thank you for your patience

Ivo

--
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 bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/948b5a7a-8ab1-460b-b7a6-8c34b7fc1292%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

⌁   Link to post
Christopher_Bottcher
Christopher_Bottcher

Hello,

I’am searching for the same thing.

My project has two select fields. The first selection generates a list, which I want show in the second selection.
The callback works but the new list isn’t show in the second selection.
I use the options property, like Bryan suggested.

Is there a solution???
Is it possible to update a Select widget?

Thanks for the 0.12 version. I like the new layout.

Best regards

the_driver02

⌁   Link to post
Bryan
Bryan

Hello,

I'am searching for the same thing.

My project has two select fields. The first selection generates a list, which I want show in the second selection.
The callback works but the new list isn't show in the second selection.
I use the options property, like Bryan suggested.

But how exactly, what exactly did you try? Can you share actual code? It is impossible to speculate on what might be amiss without seeing/trying real code.

Thanks,

Bryan

···

On Jul 6, 2016, at 7:19 AM, 'the_driver02' via Bokeh Discussion - Public <bokeh@continuum.io> wrote:

Is there a solution???
Is it possible to update a Select widget?

Thanks for the 0.12 version. I like the new layout.

Best regards

the_driver02

--
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 bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/ae84e4ae-49d4-4e65-9065-bf03d933740f%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

⌁   Link to post
Christopher_Bottcher
Christopher_Bottcher

At the moment I use bokeh serve to plot some data from a database.
I want to select interactively from all my tables some data. With static lists I can generate my sql code and modify the ColumnDataSource. Plotting works fine.
But how can I modify a select widget?

The button “buttonshow” (example below) shows me (via print), that the list cols has successfully changed. But how can I update the options of my select widget “selectcols” ?

Is there a possibility to change bokeh widgets on a server?

a snippet from my testprogram:

from bokeh.models.widgets import Select, Button, Slider, CheckboxGroup, DateRangeSlider, DatePicker, TextInput
from bokeh.models import ColumnDataSource
import numpy as np
from bokeh.plotting import *
from bokeh.layouts import row, column, widgetbox
import cx_Oracle

views=[“tbl_TDR”,“tbl_TEMP”,“tbl_FLUX”]
cols=

def getcols(attrname, old, new):
table=selectviews.value
data = cursorS.execute(“”"
select column_name from ALL_TAB_COLUMNS
where TABLE_NAME=‘“”" + table +"’")
y=data.fetchall()
for i in range(0,len(y)):
cols.append(y[i][0])
print(cols)

def showcols():
print(cols)

selectviews = Select(title=“Views”, options=views, value=“”)
selectviews.on_change(“value”,getcols)
selectcols = Select(title=“Cols”, options=cols, value=“”)

buttonshow = Button(label=“show”)
buttonshow.on_click(showcols)

curdoc().add_root(row([selectviews,selectcols,buttonshow]))

···

Am Mittwoch, 6. Juli 2016 14:56:36 UTC+2 schrieb Bryan Van de ven:

On Jul 6, 2016, at 7:19 AM, ‘the_driver02’ via Bokeh Discussion - Public bo...@continuum.io wrote:

Hello,

I’am searching for the same thing.

My project has two select fields. The first selection generates a list, which I want show in the second selection.

The callback works but the new list isn’t show in the second selection.

I use the options property, like Bryan suggested.

But how exactly, what exactly did you try? Can you share actual code? It is impossible to speculate on what might be amiss without seeing/trying real code.

Thanks,

Bryan

Is there a solution???

Is it possible to update a Select widget?

Thanks for the 0.12 version. I like the new layout.

Best regards

the_driver02

–
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 bokeh+un...@continuum.io.

To post to this group, send email to bo...@continuum.io.

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/ae84e4ae-49d4-4e65-9065-bf03d933740f%40continuum.io.

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

⌁   Link to post
Christopher_Bottcher
Christopher_Bottcher

Okay, I found a solution. → with bokeh server 0.12
First we save our python data in a ColumnDataSource.
In the python function we must trigger the ColumnDataSource.

Now, we can access the Data with CustomJS and change the options of the select field.

Just one more thing. How can I excecute the python def before the js callback?

source = ColumnDataSource(data=dict(entry=,value=))

def getcols(attrname, old, new):
list=
table=selectviews.value
data = cursorS.execute(“”"
select column_name from ALL_TAB_COLUMNS
where TABLE_NAME=‘“”" + table +"’")
y=data.fetchall()
for i in range(0,len(y)):
list.append(y[i][0])
source.data[‘entry’] = list
source.trigger(‘data’, source.data, source.data)

callbacks = CustomJS(args=dict(source=source), code=“”"
var f = cb_obj.get(‘value’);
var data = source.get(‘data’)
s2.set(‘options’, source.data[‘entry’]);
s2.trigger(‘change’);
“”")

selectviews = Select(title=“Views”, options=views, value=“”,callback=callbacks)
selectviews.on_change(“value”,getcols)
s2 = Select(title=“Select2”, value=‘initial value in your dropdown’)
callbacks.args[“s2”] = s2

···

Am Mittwoch, 6. Juli 2016 16:42:27 UTC+2 schrieb the_driver02:

On Jul 6, 2016, at 7:19 AM, ‘the_driver02’ via Bokeh Discussion - Public bo...@continuum.io wrote:

Hello,

I’am searching for the same thing.

My project has two select fields. The first selection generates a list, which I want show in the second selection.

The callback works but the new list isn’t show in the second selection.

I use the options property, like Bryan suggested.

But how exactly, what exactly did you try? Can you share actual code? It is impossible to speculate on what might be amiss without seeing/trying real code.

Thanks,

Bryan

Is there a solution???

Is it possible to update a Select widget?

Thanks for the 0.12 version. I like the new layout.

Best regards

the_driver02

–
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 bokeh+un...@continuum.io.

To post to this group, send email to bo...@continuum.io.

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/ae84e4ae-49d4-4e65-9065-bf03d933740f%40continuum.io.

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

At the moment I use bokeh serve to plot some data from a database.
I want to select interactively from all my tables some data. With static lists I can generate my sql code and modify the ColumnDataSource. Plotting works fine.
But how can I modify a select widget?

The button “buttonshow” (example below) shows me (via print), that the list cols has successfully changed. But how can I update the options of my select widget “selectcols” ?

Is there a possibility to change bokeh widgets on a server?

a snippet from my testprogram:

from bokeh.models.widgets import Select, Button, Slider, CheckboxGroup, DateRangeSlider, DatePicker, TextInput
from bokeh.models import ColumnDataSource
import numpy as np
from bokeh.plotting import *
from bokeh.layouts import row, column, widgetbox
import cx_Oracle

views=[“tbl_TDR”,“tbl_TEMP”,“tbl_FLUX”]
cols=

def getcols(attrname, old, new):
table=selectviews.value
data = cursorS.execute(“”"
select column_name from ALL_TAB_COLUMNS
where TABLE_NAME=‘“”" + table +"’")
y=data.fetchall()
for i in range(0,len(y)):
cols.append(y[i][0])
print(cols)

def showcols():
print(cols)

selectviews = Select(title=“Views”, options=views, value=“”)
selectviews.on_change(“value”,getcols)
selectcols = Select(title=“Cols”, options=cols, value=“”)

buttonshow = Button(label=“show”)
buttonshow.on_click(showcols)

curdoc().add_root(row([selectviews,selectcols,buttonshow]))

Am Mittwoch, 6. Juli 2016 14:56:36 UTC+2 schrieb Bryan Van de ven:

⌁   Link to post
Bryan
Bryan

Just one more thing. How can I excecute the python def before the js callback?

Apologies, I am not quite sure what you are asking to accomplish from this description. Maybe you can provide more detail or context.

Bryan

···

On Jul 8, 2016, at 7:34 AM, 'the_driver02' via Bokeh Discussion - Public <bokeh@continuum.io> wrote:

Okay, I found a solution. -> with bokeh server 0.12
First we save our python data in a ColumnDataSource.
In the python function we must trigger the ColumnDataSource.

Now, we can access the Data with CustomJS and change the options of the select field.

source = ColumnDataSource(data=dict(entry=,value=))

def getcols(attrname, old, new):
        list=
        table=selectviews.value
        data = cursorS.execute("""
        select column_name from ALL_TAB_COLUMNS
        where TABLE_NAME='""" + table +"'")
        y=data.fetchall()
        for i in range(0,len(y)):
            list.append(y[i][0])
        source.data['entry'] = list
        source.trigger('data', source.data, source.data)

callbacks = CustomJS(args=dict(source=source), code="""
var f = cb_obj.get('value');
var data = source.get('data')
s2.set('options', source.data['entry']);
s2.trigger('change');
""")

selectviews = Select(title="Views", options=views, value="",callback=callbacks)
selectviews.on_change("value",getcols)
s2 = Select(title="Select2", value='initial value in your dropdown')
callbacks.args["s2"] = s2

Am Mittwoch, 6. Juli 2016 16:42:27 UTC+2 schrieb the_driver02:
At the moment I use bokeh serve to plot some data from a database.
I want to select interactively from all my tables some data. With static lists I can generate my sql code and modify the ColumnDataSource. Plotting works fine.
But how can I modify a select widget?

The button "buttonshow" (example below) shows me (via print), that the list cols has successfully changed. But how can I update the options of my select widget "selectcols" ?

Is there a possibility to change bokeh widgets on a server?

a snippet from my testprogram:

from bokeh.models.widgets import Select, Button, Slider, CheckboxGroup, DateRangeSlider, DatePicker, TextInput
from bokeh.models import ColumnDataSource
import numpy as np
from bokeh.plotting import *
from bokeh.layouts import row, column, widgetbox
import cx_Oracle

views=["tbl_TDR","tbl_TEMP","tbl_FLUX"]
cols=

def getcols(attrname, old, new):
        table=selectviews.value
        data = cursorS.execute("""
        select column_name from ALL_TAB_COLUMNS
        where TABLE_NAME='""" + table +"'")
        y=data.fetchall()
        for i in range(0,len(y)):
            cols.append(y[i][0])
        print(cols)
        
def showcols():
        print(cols)
        
selectviews = Select(title="Views", options=views, value="")
selectviews.on_change("value",getcols)
selectcols = Select(title="Cols", options=cols, value="")

buttonshow = Button(label="show")
buttonshow.on_click(showcols)

curdoc().add_root(row([selectviews,selectcols,buttonshow]))

Am Mittwoch, 6. Juli 2016 14:56:36 UTC+2 schrieb Bryan Van de ven:

> On Jul 6, 2016, at 7:19 AM, 'the_driver02' via Bokeh Discussion - Public <bo...@continuum.io> wrote:
>
> Hello,
>
> I'am searching for the same thing.
>
> My project has two select fields. The first selection generates a list, which I want show in the second selection.
> The callback works but the new list isn't show in the second selection.
> I use the options property, like Bryan suggested.

But how exactly, what exactly did you try? Can you share actual code? It is impossible to speculate on what might be amiss without seeing/trying real code.

Thanks,

Bryan

> Is there a solution???
> Is it possible to update a Select widget?
>
> Thanks for the 0.12 version. I like the new layout.
>
> Best regards
>
> the_driver02
>
> --
> 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 bokeh+un...@continuum.io.
> To post to this group, send email to bo...@continuum.io.
> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/ae84e4ae-49d4-4e65-9065-bf03d933740f%40continuum.io\.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
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 bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/ebb6dca3-008a-4e20-adfe-05f2ab8b1dab%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

⌁   Link to post
Christopher_Bottcher
Christopher_Bottcher

Hi Bryan,

the question was “How can I change the options of a Select field (bokeh serve)?”

This works with a javascript callback.

My problem is in what order the bokeh server execute the callback, when the select field was change.

The server runs first the js callback and then my function with selectviews.on_change(myfunction)
But the order must be exactly reversed, because my python function change the ColumnDataSource and then the js callback can change the options of my select field.
Otherwise I get the data of the last selection.

selectviews = Select(title=“Views”, options=views, value=“”,callback=callbacks)
selectviews.on_change(“value”,getcols)

Any sugesstion how I can reverse the order?

Best regards
the_Driver02

···

Am Freitag, 8. Juli 2016 19:30:57 UTC+2 schrieb Bryan Van de ven:

Just one more thing. How can I excecute the python def before the js callback?

Apologies, I am not quite sure what you are asking to accomplish from this description. Maybe you can provide more detail or context.

Bryan

On Jul 8, 2016, at 7:34 AM, ‘the_driver02’ via Bokeh Discussion - Public bo...@continuum.io wrote:

Okay, I found a solution. → with bokeh server 0.12

First we save our python data in a ColumnDataSource.

In the python function we must trigger the ColumnDataSource.

Now, we can access the Data with CustomJS and change the options of the select field.

source = ColumnDataSource(data=dict(entry=,value=))

def getcols(attrname, old, new):

    list=[]
    table=selectviews.value
    data = cursorS.execute("""
    select column_name from ALL_TAB_COLUMNS
    where TABLE_NAME='""" + table +"'")
    y=data.fetchall()
    for i in range(0,len(y)):
        list.append(y[i][0])
    source.data['entry'] = list
    source.trigger('data', source.data, source.data)

callbacks = CustomJS(args=dict(source=source), code=“”"

var f = cb_obj.get(‘value’);

var data = source.get(‘data’)

s2.set(‘options’, source.data[‘entry’]);

s2.trigger(‘change’);

“”")

selectviews = Select(title=“Views”, options=views, value=“”,callback=callbacks)

selectviews.on_change(“value”,getcols)

s2 = Select(title=“Select2”, value=‘initial value in your dropdown’)

callbacks.args[“s2”] = s2

Am Mittwoch, 6. Juli 2016 16:42:27 UTC+2 schrieb the_driver02:

At the moment I use bokeh serve to plot some data from a database.

I want to select interactively from all my tables some data. With static lists I can generate my sql code and modify the ColumnDataSource. Plotting works fine.

But how can I modify a select widget?

The button “buttonshow” (example below) shows me (via print), that the list cols has successfully changed. But how can I update the options of my select widget “selectcols” ?

Is there a possibility to change bokeh widgets on a server?

a snippet from my testprogram:

from bokeh.models.widgets import Select, Button, Slider, CheckboxGroup, DateRangeSlider, DatePicker, TextInput

from bokeh.models import ColumnDataSource

import numpy as np

from bokeh.plotting import *

from bokeh.layouts import row, column, widgetbox

import cx_Oracle

views=[“tbl_TDR”,“tbl_TEMP”,“tbl_FLUX”]

cols=

def getcols(attrname, old, new):

    table=selectviews.value
    data = cursorS.execute("""
    select column_name from ALL_TAB_COLUMNS
    where TABLE_NAME='""" + table +"'")
    y=data.fetchall()
    for i in range(0,len(y)):
        cols.append(y[i][0])
    print(cols)

def showcols():

    print(cols)

selectviews = Select(title=“Views”, options=views, value=“”)

selectviews.on_change(“value”,getcols)

selectcols = Select(title=“Cols”, options=cols, value=“”)

buttonshow = Button(label=“show”)

buttonshow.on_click(showcols)

curdoc().add_root(row([selectviews,selectcols,buttonshow]))

Am Mittwoch, 6. Juli 2016 14:56:36 UTC+2 schrieb Bryan Van de ven:

On Jul 6, 2016, at 7:19 AM, ‘the_driver02’ via Bokeh Discussion - Public bo...@continuum.io wrote:

Hello,

I’am searching for the same thing.

My project has two select fields. The first selection generates a list, which I want show in the second selection.
The callback works but the new list isn’t show in the second selection.
I use the options property, like Bryan suggested.

But how exactly, what exactly did you try? Can you share actual code? It is impossible to speculate on what might be amiss without seeing/trying real code.

Thanks,

Bryan

Is there a solution???
Is it possible to update a Select widget?

Thanks for the 0.12 version. I like the new layout.

Best regards

the_driver02

–
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 bokeh+un...@continuum.io.
To post to this group, send email to bo...@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/ae84e4ae-49d4-4e65-9065-bf03d933740f%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

–
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 bokeh+un...@continuum.io.

To post to this group, send email to bo...@continuum.io.

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/ebb6dca3-008a-4e20-adfe-05f2ab8b1dab%40continuum.io.

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

⌁   Link to post
Bryan
Bryan

Hi,

I am not sure there is going to be any reliable way to enforce any particular ordering between JS callbacks and server callbacks directly. The closest thing involves a bit of hackery:

  python - Throttling in Bokeh application - Stack Overflow

That sort of thing can work, but I would not describe it as ideal. But if you are using server callbacks already, I'm not sure what you would need to do in a JS callback that you couldn't just do in the server callback, where you have complete control over the order of operations. As an example related to the question in the title, you can change the options in a server callback easily:

  https://github.com/bokeh/bokeh/blob/master/examples/app/stocks/main.py#L99-L105

Thanks,

Bryan

···

On Jul 11, 2016, at 6:05 AM, 'the_driver02' via Bokeh Discussion - Public <bokeh@continuum.io> wrote:

Hi Bryan,

the question was "How can I change the options of a Select field (bokeh serve)?"

This works with a javascript callback.

My problem is in what order the bokeh server execute the callback, when the select field was change.

The server runs first the js callback and then my function with selectviews.on_change(myfunction)
But the order must be exactly reversed, because my python function change the ColumnDataSource and then the js callback can change the options of my select field.
Otherwise I get the data of the last selection.

selectviews = Select(title="Views", options=views, value="",callback=callbacks)
selectviews.on_change("value",getcols)

Any sugesstion how I can reverse the order?

Best regards
the_Driver02

Am Freitag, 8. Juli 2016 19:30:57 UTC+2 schrieb Bryan Van de ven:
> Just one more thing. How can I excecute the python def before the js callback?

Apologies, I am not quite sure what you are asking to accomplish from this description. Maybe you can provide more detail or context.

Bryan

> On Jul 8, 2016, at 7:34 AM, 'the_driver02' via Bokeh Discussion - Public <bo...@continuum.io> wrote:
>
> Okay, I found a solution. -> with bokeh server 0.12
> First we save our python data in a ColumnDataSource.
> In the python function we must trigger the ColumnDataSource.
>
> Now, we can access the Data with CustomJS and change the options of the select field.
>
>
>
>
>
> source = ColumnDataSource(data=dict(entry=,value=))
>
> def getcols(attrname, old, new):
> list=
> table=selectviews.value
> data = cursorS.execute("""
> select column_name from ALL_TAB_COLUMNS
> where TABLE_NAME='""" + table +"'")
> y=data.fetchall()
> for i in range(0,len(y)):
> list.append(y[i][0])
> source.data['entry'] = list
> source.trigger('data', source.data, source.data)
>
> callbacks = CustomJS(args=dict(source=source), code="""
> var f = cb_obj.get('value');
> var data = source.get('data')
> s2.set('options', source.data['entry']);
> s2.trigger('change');
> """)
>
> selectviews = Select(title="Views", options=views, value="",callback=callbacks)
> selectviews.on_change("value",getcols)
> s2 = Select(title="Select2", value='initial value in your dropdown')
> callbacks.args["s2"] = s2
>
>
> Am Mittwoch, 6. Juli 2016 16:42:27 UTC+2 schrieb the_driver02:
> At the moment I use bokeh serve to plot some data from a database.
> I want to select interactively from all my tables some data. With static lists I can generate my sql code and modify the ColumnDataSource. Plotting works fine.
> But how can I modify a select widget?
>
> The button "buttonshow" (example below) shows me (via print), that the list cols has successfully changed. But how can I update the options of my select widget "selectcols" ?
>
> Is there a possibility to change bokeh widgets on a server?
>
> a snippet from my testprogram:
>
> from bokeh.models.widgets import Select, Button, Slider, CheckboxGroup, DateRangeSlider, DatePicker, TextInput
> from bokeh.models import ColumnDataSource
> import numpy as np
> from bokeh.plotting import *
> from bokeh.layouts import row, column, widgetbox
> import cx_Oracle
>
> views=["tbl_TDR","tbl_TEMP","tbl_FLUX"]
> cols=
>
> def getcols(attrname, old, new):
> table=selectviews.value
> data = cursorS.execute("""
> select column_name from ALL_TAB_COLUMNS
> where TABLE_NAME='""" + table +"'")
> y=data.fetchall()
> for i in range(0,len(y)):
> cols.append(y[i][0])
> print(cols)
>
> def showcols():
> print(cols)
>
> selectviews = Select(title="Views", options=views, value="")
> selectviews.on_change("value",getcols)
> selectcols = Select(title="Cols", options=cols, value="")
>
> buttonshow = Button(label="show")
> buttonshow.on_click(showcols)
>
> curdoc().add_root(row([selectviews,selectcols,buttonshow]))
>
> Am Mittwoch, 6. Juli 2016 14:56:36 UTC+2 schrieb Bryan Van de ven:
>
> > On Jul 6, 2016, at 7:19 AM, 'the_driver02' via Bokeh Discussion - Public <bo...@continuum.io> wrote:
> >
> > Hello,
> >
> > I'am searching for the same thing.
> >
> > My project has two select fields. The first selection generates a list, which I want show in the second selection.
> > The callback works but the new list isn't show in the second selection.
> > I use the options property, like Bryan suggested.
>
> But how exactly, what exactly did you try? Can you share actual code? It is impossible to speculate on what might be amiss without seeing/trying real code.
>
> Thanks,
>
> Bryan
>
>
> > Is there a solution???
> > Is it possible to update a Select widget?
> >
> > Thanks for the 0.12 version. I like the new layout.
> >
> > Best regards
> >
> > the_driver02
> >
> > --
> > 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 bokeh+un...@continuum.io.
> > To post to this group, send email to bo...@continuum.io.
> > To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/ae84e4ae-49d4-4e65-9065-bf03d933740f%40continuum.io\.
> > For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
>
>
> --
> 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 bokeh+un...@continuum.io.
> To post to this group, send email to bo...@continuum.io.
> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/ebb6dca3-008a-4e20-adfe-05f2ab8b1dab%40continuum.io\.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
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 bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/aa378c5d-743f-4f31-82ad-17fcbfb11baa%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

⌁   Link to post

End of archived discussion · Replies are disabled