Perspective Parameter to embedded view somethimes not loaded

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:
image

Binding of the parameter to the button:

Print result of the write script:

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.

1 Like

I simplified the exprssion to show that the issue is not linked to a too compicated binding.

I Will try the persistent option. Thank you for that.

About the levels, it is Just a process screen with an embedded view on. In that embedded view I have the button component.

It might be that I have other views on the process display with more levels, can that Also affect my button which 'Follows the rules.'?

To my knowledge, it would only affect buttons in those deeper nested views, it shouldn't affect other views on the same page

The persistent option solved the issue.

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?

1 Like

:100:

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.

2 Likes

Hi,

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.

1 Like

This was a simple example to show, it's not because i have a binding with an issue in it.
I have other tags which also have the issue.

I have made a support request for this issue.

Today i had feedback that it occured again.
This is the setup of the bindings at the moment:

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.

2 Likes