Is there a way to have an axiom script function trigger when a user loads a page?
In my particular situation I am need to show when the last of a specific event type starts and ends , I do this using an invisible event table and triggering a function that writes the start and end of the event into the labels, this works as long as the display is on 24/7 and it can be triggered by the change of the tag that shows the state of the batch, however if the display is closed and then opened at a later time the values in the labels end up being old values representing a past state of the event/ an older event, as written in the tittle, is there a way i can force the display to trigger the function as soon as a user opens the display, guaranteeing in my case that the start and end values in he labels are accurate?
1 reply
-
Hi ,
If I'm understanding your use case correctly, you can place your script inside of the following command to have it run when navigating to a screen:
public void OnScreenVisible()
{ your script }You can also use the following to run a script when navigating away from a screen:
public void OnScreenInvisible()
{ your script }For additional context, this example shows how these commands can be used to trigger an event timer upon a screen opening: https://axiomscripting.canarylabs.com/26.3/html/8675300e-3c1c-42c5-8590-9e4d4e9d7627.htm
Regards,
Ethan
