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.
- View loads
- Bindings on the custom properties fire but pull in null values from the parameters (instance 1)
- Parameters are initialized on the view
- Bindings on the custom properties fire again since the binding values changed (instance 2)
- The instance 2 binding script finishes executing and writes the output value to the parameter
- 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.