How to prevent a later onClick Action from executing in Perspective?

Hi,

I have several onClick Actions on a component in Ignition Perspective.
The first action is a Script Action, and after that I have a Popup action.

Depending on a certain parameter in the project, I want to prevent the popup from opening.
I know I can use system.perspective.togglePopup() in a script, but I’m wondering:

Is there a way to stop or “break” the action chain after the script action, so that the next action (Open Popup) does not execute?

Something like:

if customProperty:
  # do something, but do NOT execute action 2 (the popup)
else:
  # continue to action 2 (open popup)

Is this possible?

Thanks!

No.

Event actions run in parallel, and browser-side actions will be happening before script actions even get started in the gateway. (Reminder, all jython scripts run in the gateway.)

If you need the popup to be conditional, you need to make it part of the script.

1 Like

The UI really does need to do a better job at conveying this as I've had numerous new comers ask me questions surrounding why actions further down the list happen before ones at the top.. Once you know, you know, but it’s the first time that catches most people out, including me

3 Likes

:face_exhaling:

4 Likes

Haha, that would be useful too, but I was actually talking about the fact they all run in parallel rather than in sequence as it first seems. They have move up and down buttons which makes it even more confusing when you find out that they don’t run in order, sequentially, as being able to reorder them only further suggests that they run in that order

2 Likes

They are ordered, and if I remember right from when I first looked into the codebase a long time ago the frontend actions do block each other as you'd expect. It's not by accident that we put all the effort into making them reorderable. It's just that the gateway actions get kicked off to a different queue and end up working out of band. Or something like that...it's been a while.

1 Like