Search code examples
pythonselectwidgetpanel

Python Panel How to force the update of the widget.Select


I have this Panel widget defined:

import panel as pn
demo = pn.widgets.Select(name='Demo', options=datasource)

How can i force the widget to update, when the datasource is also updated? I tried with this:

demo.param.update()

inside the function that also changes the datasource but it does not work. Any suggestions? Thank you.


Solution

  • Just for others reference:

    import panel as pn
    demo = pn.widgets.Select(name='Demo', options=datasource)
    
    ...
    # after changing the datasource do:
    demo.options = datasource