Updating Perspective Popup tag values

Hi, I’m new to Ignition and struggling with popups in Perspective.

I’ve created a view to use as a template. I’m using the onClick event of the root container of the template to display a popup view. I’ve created an instance of the template as an embedded view, with a UDT bound to it. I’m then trying to pass the UDT though the PARAMS of the embedded view to the popup. This all works, but the popup only displays the UDT values when it first opens, no tag values change or update after that.

How do I make the popup update to show the current tag values? I’ve seen other posts saying to pass the tag path as a string to the popup, but I can’t get this working either. Does anyone have an example of how to configure this?

Share what you tried along this line, as this is what you need. Passing parameters is always a snapshot of the values. Passing a tag path lets you indirect bind in the target view. That binding will update.

1 Like

As @pturmel said, passing params to a Popup or Page is a snapshot-in-time solution. If you want the values to update, then you need to pass something which can be used to determine a binding.

Let’s assume a tag path of [default]TagDir/MyTag, where MyTag is an instance of your UDT. I would set up an onActionPerformed Event with an accompanying Script Action. We’ll also assume I have a “template” view I want to use for my Popup located at Perspective/Views/Templates/Popups/UDTRep, and that template View expects a param named tagPath.

system.perspective.openPopup("MyUniqueIdASDF", view="Perspective/Views/Templates/Popups/UDTRep", params={"tagPath": "[default]TagDir/MyTag"})

Now, in the Popup, you’ll want to set up bindings which use that incoming tag path. In the following screenshots, you’ll see that I have a UDT instance in place, and I’ve passed that value along (in theory) to a Popup.

Note here that I’ve supplied the path to the UDT instance - NOT the individual properties/values of the UDT:
Screen Shot 2021-09-11 at 10.02.19 AM

Now my binding will use that tagPath param, and while using an INDIRECT tag binding I can complete the path to the individual value of the UDT that I want to use (PrimaryOS):

3 Likes

Just fyi, the reason to use onActionPerformed instead of onClick is the former is disabled by the button’s enabled property, whereas the onClick event isn’t

Thanks, I know have this working using the tag path as described.

1 Like