Firstly, this does work, however, I dont understand why!
I have a 'On Click' script on a object that is designed to set a session prop called 'TabSet' to a number, then change the page. The destination page has a tab container that looks at this value 'Onload', and if its not zero, it sets the tab container to the requested tab number.
In a nutshell, a way of navigating to a different page and setting the tab number if needed.
I assumed the script should be this, because we first set the prop, then we navigate to the page meaning we know our prop is set before we go.
def runAction(self, event): # Request Tab Number on Destination Page self.session.custom.tabSet = 8 # navigate to the required page system.perspective.navigate('/p&id/filling')
However, this does not work.
If I switch the order to ask for a navigate and then set the tab, it works!
def runAction(self, event): # navigate to the required page system.perspective.navigate('/p&id/filling') # Request Tab Number on Destination Page self.session.custom.tabSet = 8
However... I do not understand why. Surely if we are starting to navigate, and the loading time is too quick, the prop change could be missed?
Why is the prop not set before the script moves on to the navigate line? Does the navigate cancel the prop set?
Noted, this is the same if I use 2 different actions, a script to set the prop, and then a navigate type event.
I'm guessing theres some form of execution order here I dont understand, but would very much like too