If a PopUp is opened, and it is requested to reopen, how to refresh the params

Hi,

We have a device template with two parameters:
deviceParentPath
deviceName

When an instance of this Template is placed in another View:
The params are updated manually to give the tagname of the Device.

On the template there is a button to open a pop up to show the Device FacePlate (it has the same parameters): onActionPerformed > Popup action is used (the params are passed to the PopUp).

If the button is pressed on Device1, the PopUp is shown and all the elements are pointing to the Device Tagname Device1.
If the pop up is closed and the button is pressed on Device2, the PopUp is shown and all the elements are pointing to the Device Tagname Device2.
But if the pop up is opened, pointing to Device1, and the button is pressed on Device2, all the elements in the PopUp are still pointing to the Device Tagname Device1.

We have tried on the button:
onActionPerformed >

  1. Popup action > Close
  2. Popup action > Open (Passing the Params)

But there is no difference.

Do you know how could it be done?

Regards,
Ana

Welcome to the forum, Ana.

  1. Be aware that Popup Actions are performed asynchronously. If sequence is important then use a Script Action and system.perspective.openPopup | Ignition User Manual and system.perspective.closePopup | Ignition User Manual.

  2. Have a look at Component Message Handlers | Ignition User Manual which is designed to pass information between views.

Someone else may have a more definite answer for you.

One little thing: the FAQ - Inductive Automation Forum says not to add signatures to your posts. The username is added to each post automatically.

Thank you very much for your reply regarding my question and forum rules.
I'm still getting my head around how Ignition works, where and how scripts run,...

We are using now:
onActionPerformed > Script

system.perspective.closePopup('')
system.perspective.openPopup(id, view, params, title, showCloseIcon = True)

and it works!

**def** runAction(self, event):
id = 'Device_Template_ViewId'
view = 'Templates/Device_Template'
params = {'deviceName':self.view.params.deviceName,'deviceParentPath':self.view.params.deviceParentPath}
title = 'Device'
showCloseIcon = True
sessionId = 'd1810bd'

system.perspective.closePopup('')
system.perspective.openPopup(id, view, params, title, showCloseIcon = True)

We need to clean it to get the SessionId, but the tag binding update is working now.

From the docs linked above:

sessionId
Identifier of the Session to target. If omitted, the current Session will be used automatically. [optional]

I would think you can leave it out.


Next tip: Wiki - how to post code on this forum.