Dynamic screen navigation button

I have a handful of visual screens, each with an associated “control” screens (where one can see statuses, setpoints, etc…). During day to day operation the typical tab strip navigation has become cumbersome. My idea is to replace a button on the tab strip with a button that navigates to an associated screen via a switch statement.

In pseudocode:

SWITCH( CURRENT_SCREEN, SCREEN1, SCREEN2, SCREEN3, SCREEN4, SCREEN5, SCREEN6, SwapTo.SCREEN6, SwapTo.SCREEN5, SwapTo.SCREEN4, SwapTo.SCREEN3, SwapTo.SCREEN2, SwapTo.SCREEN1

In this case, the associated screens are 6 and 1, 2 and 5, and 3 and 4. The idea is that when the button is pressed while on screen 6, you are navigated to screen 1 - and vice versa.

Any suggestions as to the direction I should head in order to make this work?

For this you can use any component you would like. For example, you can bring in a regular button component and bind the text of the component to the current window tag [System]/Client/User/CurrentWindow.

When the user clicks on the button you can easily swap to another window. So put the following script on the actionPerformed event of the button:currentWindow = system.tag.getTagValue("[System]/Client/User/CurrentWindow") if currentWindow == "SCREEN1": system.nav.swapTo("SCREEN6") elif currentWindow == "SCREEN2": system.nav.swapTo("SCREEN5") elif currentWindow == "SCREEN3": system.nav.swapTo("SCREEN4") elif currentWindow == "SCREEN4": system.nav.swapTo("SCREEN3") elif currentWindow == "SCREEN5": system.nav.swapTo("SCREEN2") else: system.nav.swapTo("SCREEN1")My example uses the typical navigation strategy where only one main (maximized) window is open at a time held the in the current window variable. The swapTo function will simply close the current one and open the new one. Hope this helps.

Thank you - the button works perfectly.