Alarm Status Table - Refresh Inspect panel with selected alarm

I want to be able to refresh the alarm inspect panel with newly selected alarms (instead of remaining on the alarm selected originally when the panel was first opened).

I have this working, but I’m just toggling the inspect toggle button itself, which closes and re-opens the panel on alarm selection change. I’d rather not have to close the panel and instead just update the info in the panel itself.

Can I get some help with how I would do this?

FWIW this is what I have currently:

def refreshInspectPanel(alarmObj):
	Refreshes the alarm inspect panel info with the selected alarm info.
	Call on the 'selectedAlarms' property change
if event.propertyName == 'selectedAlarms':
	alarmObjInspectButton = alarmObj.getComponent(0).getComponent(1).getComponent(1).getComponent(0)
	#If the inspect button is 'selected' (i.e. the panel is shown), then toggle the button off and back on again to refresh the alarm being shown (dodgy refresh)
	if alarmObjInspectButton.isSelected():