Open Window Scripts...dependancy on docked windows

Is it possible to ensure docked windows are open prior to any main windows?

I’m asking because my main windows have dependences on my header and footer docked windows. Basically it’s a navigation synchronization thing. Primary means of navigation is using tab strip in the header, however on my main windows there are navigation arrows that allow an operator to follow the process. As a result, I have to make sure that tab strip in the header remains in sync if the operator uses a navigation arrow on the main window.

For the most part this works fine, as on the main windows I’m using the visionWindowOpened event handler to do the synchronization. The issue I have is whenever the application is updated, or a user logs on. This causes all the windows to re-open and of course triggers my visionWindowOpened event handler. If the main window is “open” prior to my docked header and footer I get an error as my references to the docked windows are invalid as they have not opened.

Is there a good way to ensure docked windows are opened first?

One way to achieve this is to not set your docked windows to “Open on Startup”. Open the docked windows yourself in the visionWindowOpened script of your main window. That way you can be sure they will be open before you use them.

Another way is to check if the windows are opened before trying to use them. If they aren’t opened then open them and then use them.

Another way is to replace system.gui.getWindow with system.nav.openWindow.


I’d agree with nmudge - if your main windows depend on the docked windows being open, you can control this on your own by using your main window’s “visionWindowOpened” event script to check for the docked windows being open and if they aren’t, you can open them right there in that script. You’ll notice in that event’s description it says:

“This event is fired each time the window is opened and before any bindings are evaluated.”

This means that anytime you open your main windows they will run that script and make sure the docked windows are open before the main window’s bindings evaluate.

Thanks for the suggestions, I ended up just putting a try/except statement, so it the call errors due to the window not being open, it will open it if it fails.