Closed samimia-swks closed 2 months ago
Thanks for the issue. To answer your question, parameter binding like you're doing is not bi-directional, i.e.
main_tabs = pn.Tabs(
("tab 0", pn.panel("tab 0 content")),
("tab 1", pn.panel("tab 1 content")),
active=ss.param.mode,
).servable()
binds the value of mode
on the ss
instance to the active
parameter but does not do the reverse. If you need the bi-directional linking you can do this instead:
main_tabs = pn.Tabs(
("tab 0", pn.panel("tab 0 content")),
("tab 1", pn.panel("tab 1 content")),
).servable()
main_tabs.link(ss, active='mode', bidirectional=True)
[panel 1.4.4, python 3.11]
I am not quite sure this is supposed to work, but figured I'd report this. If it is not a bug I'd like to know the right way to do this.
I have a Parameterized class which holds the global states of my app. The app has two main tabs, and I would like to know which tab is active though my global state class. So I did something like this:
From reading this doc I would expect both this_works() and this_doesnt_work() to trigger when I switch tabs, but only this_works() does. Is this expected?