Use of tab deactivates trigger

@piet8stevens I’d like to point out that this is not a commercial helpdesk nor a educational program. Furthermore, you already received an answer which imho was sufficient to solve this issue.
The code below should do what I think you desire: it reprints when updating the widget.

As mentoined, when using classes, best to go all the way and use methods which update the objects.
Using the Param class, make sure to always update the layout, rather than return a fully new one. The new layout will be in its default state, which becomes very obvious in tabs objects. Check out topic Panel Tabs as item in panel Column switches to first tab on widget interactions for another clear example of this.

@philippjfr In the (pending) full documentation of Param I suggest to clearly highlight the approach difference of returning a layout and moifying it. The straightforward @depends() + some_function() which is used throught the panel documentation typically returns a layout, which is to be avoided using the Param class approach!

import panel as pn
import param

pn.extension()

class ParkLab(param.Parameterized):

    StartTime1_s = param.Number(0.000, step=0.001, precedence=0)
    UpdateGraphsTrigger = param.Integer(default=0)
    caption = pn.pane.Markdown('Portal', width=450)
    layout = pn.Param()
    Cp = pn.Param()

    def __init__(self,**params):
        super().__init__(**params)
        self.layout = pn.Tabs(('Beginning', updateGraphs),
                       ('StartTime1_s', self.param.StartTime1_s))
        self.Cp  = pn.Column(self.caption, 
                       self.param.UpdateGraphsTrigger, 
                       self.layout)
        
    @pn.depends('UpdateGraphsTrigger',watch=True)
    def updateGraphs(self):
        print('Test'+str(self.UpdateGraphsTrigger))
        combined_text = pn.pane.Markdown('Test'+str(self.UpdateGraphsTrigger))
        return combined_text
lab = ParkLab()
lab.Cp
1 Like