Perspective Parameter to embedded view sometimes not loaded.
I have a button with several parameters which i use as an embedded view on several views. This button then writes a value in the PLC based on these parameters via a script.
I noticed that sometimes the buttons do not work. Refreshing the page solves that issue for a while. But it popups again after a while on random buttons.
I noticed that the parameters are not always loaded completely. I think it is only when the parameter is linked via a binding.
I used the parameter as text on the button to see if it has the desired value. But this shows ânullâ as seen in the screenshot.
Can I solve this issue because it is a big problem in my current project.
Most of the time, it is all fine and it does what it must be. I can replicate the issue if I reload my page 10, i at least have this issue once on a button.
Button text when it is broken, this text is a binding to the parameter with the issue:
Based on your second image, the items are all static strings, so why even use an expression?
Something that might help, select each item in params.ArrTag_To_Write, right click, and check the box that says persistent. This will make it load in with the value it had in the designer.
Also, how many levels deep are you with embedding(view in a view in a view)? I remember that issues start appearing at 4 or 5 levels deep of embedding and passing parameters through that chain.
If you add a binding to the parameter, the designer automatically changes the setting to persistent disabled.
If I enable it, the issue doesnât shows up.
But do you risk having a wrong value as parameter this way? So that if you page loads, the parameter doesnât come from the binding, but from the original value of the designer?
Bindings (except view.custom) disable parameter persistence by default for this exact reason. Re-enabling persistence is almost never the ârightâ fix. (I believe Ryan was suggesting it as a debug method). Perhaps give it some âdefaultâ bad value like âthis is brokenâ and then try to narrow down the edge cases that result in that text being displayed. Same thing as ânullâ really though. But perhaps more intuitive.
So this indeed "fixed" the problem, it looks like loading the binding is an issue.
Strange that other user don't see this issue, i don't think i do anything special here?
I marked the persistent on all my buttons for the moment and it looks like that works better than before. I mean that the binding isn't sending wrong data at the moment because i didn't get any feedback that the button's do not work anymore.
generally, re-enabling persistence on a binding means - when the binding canât/doesn't resolve for any reason, display the value that was last saved in the designer instead of ânullâ
If thatâs the intention and developers judiciously ensure the ârightâ value is saved in designer every time that view is modified, then fine.
I hadnât looked at your screenshots prior to posting that though
In your case, the binding isnât dynamic in any way (as Ryan mentioned), so you could alternatively just disable/remove the bindings (which would automatically re-enable persistence). However the automatic persistence toggling stops working once youâve manually toggled persistence - youâll need to completely recreate the params. In your case, (after deleting the bindings), you can right-click >copy ArrTag_To_Write object, then right-click > delete, then create a new key, name it the same, then right-click > paste
I too have seen purely static âbindingsâ fail to resolve - presumably because thereâs no âtriggerâ, but in theory they should evaluate at least once on view inititialization.
might be worth a support ticket for some definitive feedback
I generally do not use persistence to supply initial values for parameters. I find it more robust to encode such defaults in a downstream expression using coalesce() to handle the null that a non-persistent property starts with.
Then you don't have to take special care to save the correct values in the designer.
I had contact with the support team.
We could narrow down the issue to the arrays.
So if you have a binding to an array parameter and you have a display with several embedded screens, it can happen that the embedded screen loads without processing the binding first.
If i change the arrays to objects, the issue doesn't seem to popup.
The support team raised an internal ticket for this issues with the arrays.