Open and close docked windows

Hello,

I would like to open a docked window when a certain main window is open. And then open a different docked window when an other main window is opened.

I have tried to do this with “InternalActions” on the specified pages, but this leaves me with an error.

Is there somehow to do this? My docked window is a top bar, that are present at all pages. Except one, where a different docked window much replace the top bar.

Thanks in advance

1 Like

Is this Vision or Perspective?

It is in Vision

If you allways need a docked window but that window can change depending on the main window open, maybe you can just do the following:

  1. On the window that you need a different docked window to accompany it, add the following script under the Vision Window-VisionWindowOpened event handler:
mainDockedWindow = 'Insert here the path to the window you must close'
differentDockedWindow = 'Path to the window you must open'
system.nav.closeWindow(mainDockedWindow)
system.nav.openWindow(differentDockedWindow)
  1. On the same window, under the event handler called VisionWindowClosed, add the following script:
mainDockedWindow = 'Insert here the path to the window you must open'
differentDockedWindow = 'Path to the window you must close'
system.nav.closeWindow(differentDockedWindow)
system.nav.openWindow(mainDockedWindow)

So, every time you open the main window that needs a different docked window, this script will close your main docked window and open the different docked window, the one you need, then, when you close this main window, it’ll just revert what the first script did.
You can also do the same by changing the scripts that open and close your main window.
I hope this is what you’re looking for.

Thanks for your reply.

This solution works one time. The correct docked window closes and opens when the certain pages are opened. But if I try to navigate trough some pages, and back to the certain page. It will not close the docked window and open the different docked window…

So it almost works :slight_smile: Just need to having it working every time I navigate to and from it.

I am using “Tap Strip” with “Swap windows” for my main pages.

1 Like

Maybe it’s a thing about the cache policy? You can try and change the event handler to InternalFrameActivated and InternalFrameClosed, or use this script on your Tab Strip:

if event.propertyName == 'selectedTab':
	mainDockedWindow = ""
	differentDockedWindow = ""
	differentMainWindow = 'Path to the window that uses a diff. docked window'
	if event.newValue == differentMainWindow:
		system.nav.closeWindow(mainDockedWindow)
		system.nav.openWindow(differentDockedWindow)
	else:
		system.nav.closeWindow(differentDockedWindow)
		system.nav.openWindow(mainDockedWindow)

The scripting on Tap strip helped, with a little modification:

window = system.gui.getParentWindow(event).getComponentForPath(‘Root Container.Tab Strip’).selectedTab

mainDockedWindow = “”
differentDockedWindow = “”
differentMainWindow = ‘’
if window == differentMainWindow:
system.nav.closeWindow(mainDockedWindow)
system.nav.openWindow(differentDockedWindow)
else:
system.nav.closeWindow(differentDockedWindow)
system.nav.openWindow(mainDockedWindow)

Thanks for your help

I’m glad i was able to help.
P.S: I also forgot to mention that my script was meant for the “propertyChange” event handler of the tab strip

Yes I found out :wink:

This:

inside this:

is not going to work as you expected. You will always fall inside else statement

1 Like

Yeah you’re right, i should’ve used event.newValue instead, thanks.
I’ve edited my so i don’t misguide anyone else

1 Like