Maybe I repeat a topic or question, but I could not find the working answer in the forum.
I understand that loading a popup works asynchronously so when binding a parameter to a label it is not always shown.
What is the correct way to make sure that the binding shows the value even when they load in different order?
can you show us your setup?
I can't say I have experienced the parameters not rendering in bindings like this before.
How are you calling it (Button Click, other script, etc.)?
What does the binding look like on the label side?
Is there a chance you're passing a null value to the popup when you invoke it?
I have seen issues when using PARAMS as type array. As far as I know this is still a bug in the latest release. As previously stated, you should include more details.
So the view to be reused is setup like this with the params:
There is a direct binding to the param actieTitel:
When I use the code to open the popup from a button:
When I press the button, the actieTitle is not always filled.
I solved it for the moment by filling a memory tag in the code before opening the popup and then pass the tagPath. On the text prop I use an indirect binding. this gives me every time the button is pressed the correct actieTitle in the box.
Post code, not pictures of code, please see Wiki - how to post code on this forum. It helps others when troubleshooting.
The line popupId = "[default]FFBE/P010/Mixing/Mixer 8_popup"
is not doing what you think it's doing. That is just assigning the string value of "[default]FFBE/P010/Mixing/Mixer 8_popup"
to the variable popupId
, not reading the tag value at that path.
To read a tag value from a script you need to use a system.tag.read*
function.
Second what @ryan.white said.
Another question is not use the popup option in the actions? You should do a few things to make your life easier as well as make this more supportable.
1.) Add that tag as a custom property on the view
2.) Switch to using the popup option in the actions add prompt
3.) Add in the items you have in popupParams
as custom properties and put those in the params section of the popup params option in the config window.
This will allow for easy changes later to how this all works.
If you have multiple places where you do this exact same thing but with different tag paths etc. then make this its own component and then you have a highly reuseable button to open popups from an onClick that you just have to drag onto the screen and supply with a tagpath.
If you are doing SCADA with perspective, this is the way. Always be thinking about supportability. Tis a hill I will die on.
1 Like