Window Open / Close Script

Hi All,

I’m having a little trouble with a script and i’m hoping to get some assistance.

I have a Tabbed Navigation project. As part of the project I have a few docked windows that I would like to only open when certain Tabs are selected.

I have added a property change script on my First Tier Tabs as follows, however it does not seem to be functioning (docked windows are always closed). Any ideas?

if system.gui.getParentWindow(event).getComponentForPath('Root Container.First Tier Tabs').name == "Butter":
	system.nav.closeWindow('Milk CIP Docked Window')
	system.nav.closeWindow('Milk Production Docked Window')

elif system.gui.getParentWindow(event).getComponentForPath('Root Container.First Tier Tabs').name == "Milk":
		system.nav.openWindow('Milk Production Docked Window')
else: 	system.nav.closeWindow('Milk CIP Docked Window')

If you want to open the windows from the tab, you could use a property change script on the tab object where:

if event.propertyName == 'selectedTab'
    if newValue == 'Butter':
        system.nav.openWindow('Milk CIP Docked Window')

On every tab property change you can check if you want the window opened or closed.

However, I wouldn’t recommend opening and closing docked windows. Usually they are open the entire time. You could put the information from the docked window into a template and just place it on the screens you want it on.

Thanks Nick,

I’ll give this a try