Hi there! I’m new to Panel, and I think I may be missing something as I try to understand.
In the below app, I’ve written a method _sync_params
that just prints “done” whenever it’s called. With the param.depends
decorator the way it is, I’d expect this to happen when either the button is pressed or the active file in the file chooser is changed.
But instead, “done” only appears when the button is pressed. Interacting with the file chooser doesn’t print anything, and furthermore even causes the button to stop working.
import panel as pn
from panel.viewable import Viewer
import param
pn.extension()
class TestChooser(Viewer):
def __init__(self, **params):
self._selector = pn.widgets.FileSelector()
self._button = pn.widgets.Button(name='Click')
super().__init__(**params)
self._layout = pn.Column(self._selector, self._button)
def __panel__(self):
return self._layout
@param.depends('_selector.value', '_button.value', watch=True)
def _sync_params(self):
print('done')
chooser = TestChooser()
chooser.servable()
What am I missing, and how might I fix this example to print when the file is changed as well?