Perspective bindings updating will null parameter data

I’m currently working on a popup view in Perspective that gets a few parameters passed in. I then have a few additional custom properties that are bound to the parameters as well as a few other component properties on the view using an expression structure binding with an associated script transform.

Using this method I have been getting very weird results. Based on the debugging I have done so far, this is what appears to be happening.

  1. View loads
  2. Bindings on the custom properties fire but pull in null values from the parameters (instance 1)
  3. Parameters are initialized on the view
  4. Bindings on the custom properties fire again since the binding values changed (instance 2)
  5. The instance 2 binding script finishes executing and writes the output value to the parameter
  6. The instance 1 binding script finishes executing and errors out the parameter due to null data

This is not what always happens as there are some obvious race conditions happening here, but my question is why? Why are my bindings firing before the parameters on the view are even initialized? Is there a way to implement some kind of “If not initial change” function like can be done on change scripts? This is not the first time I have run into this and it is extremely annoying to debug.

Is there any chance you could supply the view you are using for the popup and an example of you you’re opening the Popup (Script or Action and what param values are being passed)? It’s not clear from your description what exactly is happening. It sounds like you should provide some sort of value checking in a transform of the binding to handle null/None, or perhaps provide a default value for the param. It’s hard to tel without knowing the exact use-case and what is allowed/expected. Is your problem that the property does not exist (is not Persistent), or is your problem that the value of the property is evaluated before the param value is applied? Also, what version are you using?