OnClick Navigate Event "Received event for missing view"

I have a flex repeater that dynamically shows a view. In these views I have two clickable buttons. Each button navigates to a page and passes an ID parameter.

I have noticed when I navigate via the navigate action my error log fills up with the following error
'Received event for missing view "Project/Widgets/Machine@C$0:2[0]"

When I do the same thing via a script the error message does not appear.

It's not a big deal to do everything with the script, but I am curious why the error happens with the navigate event.

I don't get that error when I use a Navigation Action, so I highly suspect it's the result of something else. What Events do you have configured within the View being instanced within the Flex Repeater (other than the onClick)?

I have good amount of Bindings and one change script on the that view.
But I have disabled all but the navigation action and still had the same effect.

Some of the key events are a Query Binding, an on Click Binding on the root and an on change for a is_selected parameter.

How my "Widget" works is when a user selects anywhere on the object in the flex repeater it highlights green to show which one is selected. It also has a table object in it that can be expanded to show all the tools loaded to that machine. The Tool Table gets it's data from a SQL binding in a custom property in my "Widget" view.

Change scripts are usually an area to look at, especially if they write to a property during their lifecycle. The script continues to execute on the back-end, but then when it tries to write to a property, that front-end property has vanished. Really though, anything in that View which writes to a property could be the culprit, if the write is part of some event which could still be executing while or after the navigation is performed. You might have a race condition in your View.

  1. User clicks Open Machine link when the widget is not already selected.
  2. Link onClick executes, which begins navigation - the first step of which is to remove the current View.
  3. Widget onClick executes after because the event has to bubble-up.
  4. The Widget onClick attempts to write the highlight color to the Widget, but the Widget no longer exists because the View it lives in is gone.

Thanks I'll do some more digging and check these.

I should be able to disable all my scripts and binding and just turn them on one at a time until I find which one is causing the problem.

Maybe. If it's a race condition, it might not happen every time. Welcome to the frustration of Quality Assurance. I wouldn't worry about plain bindings, but any change scripts, any Events which have Script Actions, and any binding transforms could all be a cause.

1 Like

I think it is a race condition.
When I have a Navigate action as well as a script action, some of the scripted statements, specifically system.perspective.sendMessage ends up without a source to be executed from and I get a Warning log "Received event for missing view ".
I think the intended receiver can't trust a message without a source so the message handler is rejecting the message.
Changing the order of the script and the navigate actions doesn't make a difference.
The fix is simple: delete the Navigate action and put system.perspective.navigate at the end of the script. All of the scripted statements are executed before the navigate statement takes the parent view away.
Ignition 8.1.43

It definitely is, made possible by how the events on perspective objects are executed.

Correct, this makes no difference. While they are called in order, per the user manual:
"However, Actions are not executed synchronously: sequential actions do not wait for any prior Actions to finish executing before running."

Including the navigation in your actual script action at the very end of the script is the only way you can ensure the script completes before you actually navigate.

yes, that is what I said.

That's on me for poor wording, I was trying to explain why the race was happening and confirm that sticking the navigation at the end of the script is the only way to prevent the race condition.

1 Like