Linking Panel buttons to changing dropdowns

I am new to panel and I am trying to link this header with selectable buttons to a changing dropdown menu’s. I saw in the documentation the .link function but I am not sure if that’s applicable here. My code is throwing no error, just not properly changing the dropdown.

import panel as pn
import param

class DropdownMenus(param.Parameterized):
    header = param.ObjectSelector(objects=['Option 1', 'Option 2', 'Option 3'], default='Option 1', doc="Header")
    
    def view(self):
        header = pn.widgets.RadioButtonGroup(name='Header', value=self.header, options=['Option 1', 'Option 2', 'Option 3'], width=100)
        
        if self.header == 'Option 1':
            dropdown = pn.widgets.Select(name='Dropdown 1', options=['Option 1.1', 'Option 1.2', 'Option 1.3'], width=100)
        elif self.header == 'Option 2':
            dropdown = pn.widgets.Select(name='Dropdown 2', options=['Option 2.1', 'Option 2.2', 'Option 2.3'], width=100)
        else:
            dropdown = pn.widgets.Select(name='Dropdown 3', options=['Option 3.1', 'Option 3.2', 'Option 3.3'], width=100)
        
        header.param.watch(self._update_header, 'value')
        return pn.Column(header, dropdown)
    
    def _update_header(self, event):
        self.header = event.new
        self.param.trigger('header')

DropdownMenus().view()

I think this is pretty straightforward, but just so I am clear: the dropdown options are sub-options depending on header?

If my interpretation is correct, this should work. FYI, there are a bunch of ways to do this, but this seemed to be most consistent with how you had it set up originally:

import panel as pn
import param
pn.extension()

class DropdownMenus(param.Parameterized):
    header = param.ObjectSelector(objects=['Option 1', 'Option 2', 'Option 3'], default='Option 1', doc="Header")
    dropdown = param.Selector(objects=['Option 1.1', 'Option 1.2', 'Option 1.3'])

    @param.depends('header', watch = True)
    def _update_header(self):
        self.param['dropdown'].objects = {
            'Option 1':['Option 1.1', 'Option 1.2', 'Option 1.3'],
            'Option 2':['Option 2.1', 'Option 2.2', 'Option 2.3'],
            'Option 3':['Option 3.1', 'Option 3.2', 'Option 3.3']
        }[self.header]


    def view(self):
        wheader = pn.widgets.RadioButtonGroup.from_param(self.param['header'])
        wdropdown = pn.widgets.Select.from_param(self.param['dropdown'])

        return pn.Column(wheader, wdropdown)  
    

DropdownMenus().view()