Startup window after publishing changes

When I publish changes right now the main screen is staying on the page it was, prior to the publish, after it reloads. I’d like it to return to the window that is selected for open on startup. I’ve tried a few different things through the property change script to try to force it to swap to the home screen but none of them have worked. Out of curiosity I used the system.nav.getCurrentWindow function and printed the results to the console. In there the results of the print are telling me the window I want to open is the current window even though the actual window that was loaded is the one that was opened prior to publishing changes.

Has anyone run into this before? Any suggestions on how to force it to open the correct window?

Verify you are ‘swapping’ from open window to main window. Its possible the main window is opening in the background. The getCurrentWindow function will only return the ‘main screen’ even though 2 are open.

1 Like

I didn’t even think to check if its opening another main window. Even though I’m using the swapTo function it is opening another main window as it restarts. Now the fun is figuring out how to stop it from doing that.

Could use system.gui.getOpenedWindows() to get all opened and close the ones you don’t want? Not sure about the timing of your scripts.

One of the windows in your config is not properly defined as a "main" window - all windows are technically the same object, so they are differentiated by properties. To be a proper 'main window' to work with swapTo, your window should be:

A Main window is one that is set to start maximized, and has its Border and Titlebar display policies set to 'When Not Maximized' or 'Never.

These are the settings on the window I have set for the start up window. I also checked one of the screens thats staying up and it is set up the same way.

I think it may be a timing issue. Using system.nav.getCurrentWindow() in the property change script it cycles twice during start up, the first time it returns none. The second time it returns the window I want loaded.

I got it figured out. In my script I needed it to wait for the componentRunning newValue to be true before changing a setting. I added that in and now it loads like I wanted it to. Thank you Nick and PGriffith. Nick getting me to notice it was opening extra windows got me looking in the right direction.

1 Like