Passing a Parameter or other info into a pop-up label

I have a label on my view "Primary Area" and I want to open a pop-up using the "create event" option.
I then selected on mouse "click", pop-up and then selected the other view "sensorID" that I want to pop up and this functions just fine.

However, my pop-up "sensorID" is just a label were I want to have the text filled in by the label on the other original view to be able to add further details about the label. I know that I need to reference something to do this but nothing I try works. The goal is for the pop-up named "sensorID" to be used any time I want to access more details.

Any assistance would be appreciated.


system.perspective.openPopup(id="sensorID", view="SomeView", params={"label_text": self.props.text})

Then the SomeView View used by the Popup needs to have a param named label_text. Bind the Label.props.text prop of the Label in SomeView to the label_text param.

1 Like

Thank you for the quick reply. First off forgive me I am new to Ignition and this style of coding. I am versed in PLC programming.

With that said....where would this script be used.

In the component's onMouseClick event. You seem to be using a label. A button may be more appropriate but maybe the label works well for some reason.

It depends on how you expect a user to open the Popup. The usual placement is in an onActionPerformed (or onMouseClick) Event of a Button, but if you expect the Popup to be something along the lines of an informational modal, you might want to place the script in the onContextClick Event of the Label component.

It really depends on the use-case of the Popup and how you expect a user to open the Popup.

OK ... so the pop-up opens when the "label" I have is selected.
However, the text or params from the "label" that I select do not pass into the pop-up at all. How to I reference something such as a prop, param, or custom in the pop up text from the view that I am selecting it from?

Otherwise I don't get any relevant information on the pop-up?

Labels can't be "selected". Do you mean "clicked"?

It's much more helpful if you share your code so that we can verify it's being applied as described. Please use the formatting tool to make it easier to parse your code.

This is NOT something you can do. The Popup does not expose any of its data to the Page, just as the Page exposes no data to the Popup. If you need to share information back-and-forth between a Page and Popup, you will need to look into either using Message Handlers or custom session properties. The original solution I provided was simply to open the Popup and pass a parameter to the View as a sort of one-way communication, providing the View information it expects in the form of a param. Anything in your View can reference the param by binding to it or referencing it in a script.

Code for Pop-up that you supplied with my various changes. This works fine.
system.perspective.openPopup(id, view="Pop-up/SensorID", params={"sensorID":self.props.text})

What we usually do is associate a popup with something like a UDT and then we can pass info into the pop-up by params but since this label that I am clicking on and then running the script to open the pop-up does not have params I don't know what to do to get the info I want to be displayed in my "text" on the pop-up. We do this in several ways through various embedded views and such. All I want is to be able to have some sort of information style window so that I can give more information on the clicked on device. If I was using Factory Talk I could simply hide the text and make it appear once the label was "clicked". However I don't think that ignition can do this so I was trying to use another "view" as a popup to supply more info on the element.

It shouldn't. The very first argument in that function call should cause a NameError because you haven't declared/initialized id. Please supply your full code. If that is your full code, then something else is opening the popup.

If you want the Popup to display more information about the UDT, then you should pass more information than just the text I had previously described how to do. You have loads of options here. The most convenient option is to pass the Popup the path of the UDT being used in this View, then allow the Popup to use that path as needed. Alternatively, you could supply multiple params which each supply some piece of information you need.

I am sorry if I am not more clear ... I really have no idea how to pass more information via scripting. I am used to programs like your vision where I can select and point. This perspective is really challenging me...

The scripting I provided you is all that is tied to the popup and it does pop up the other view. But the text is only what we bound it to on the "view". Please let me know what you need to review to maybe tell me what I am doing wrong.

I don't know how to send "pass" more information... I tried some of the things that we have on the other similar setups but they are not popups but actual views so it seems to work a little different.

I think we need to go back to the goal of what you're trying to do and establish that first.

You have this main View:

You want to click on a label on the View to open a popup with more information.

  • Where does the extra information/detail come from?
  • What are some examples of the extra details?
  • Can you show a screenshot of the popup?

Generally, a popup that is used to display info for many of the same "devices" / UDT instances / etc., use the popup View's params properties to pass the information to them in order to display the popup with the info for the given device/udt instance/thing.

For example, for a Motor faceplate popup, you might have a param.deviceTagPath which is used to pass in the tagpath to a motor's UDT instance. Then inside of the popup, you would then use indirect tag bindings to display and use the values of tags within the motor's UDT instance, for example its Status/Mode/alarms/etc.

It doesn't sound like you're using UDTs for your situation, so we need to know where you're storing the info that you want to display in the popup, e.g. database table, tags, or simply just wanting to pass in values via parameters to display (this is the least preferable option since then you have no central management of it).


First off I did change to a UDT so I have more options.

The end goal is to click on one of the Green Labels shown in the view below. Then the popup is called. In the popup I want to be able to display some text that would give the user revelent information to the particular device that they clicked on.


You reference “you might have a `param.deviceTagPath” but how is this tied to my params?```


So if you're using udts, then I would remove all of your popups params as they are and add a deviceTagPath param. On your green dots, pass the relevant udt instance's tag path to the popup either via script as per Cody's example

system.perspective.openPopup(id="sensorID", view="SomeView", params={"deviceTagPath": "path/to/UDTInstance" })

, or using the popup action and use the gui it provides.

In your popup, on your label's props.text property, add a binding, select tag and then indirect. In the path use {1}/SensorId and then bind the number 1 param to view.params.deviceTagPath

SensorId should be a tag in your UDT instance to display the value of

I really appreciate the suggestions..... is there any examples I can reference. I am "very" new to this type of programming/coding. All my experience is in PLCs and trying to figure out where all the suggestions are tied to is confusing. I am really starting to catch on to some of it but when it gets more complicated I start to get lost.


I think I did what you suggested and I am further than I was before!! Below is the scripting that I entered.
However, all that appears in my popup now it the "OTSE_MFG/Reel/Primary Area/_71_5048_SM611_FS1_SpoolReleaseLocked/parameters" that is in the scripting not the actual UDT info. This is where I start to get stuck....not sure how to point to the actual path vs. just text.

<def runAction(self, event):>
<system.perspective.openPopup(id="sensorID", view="Pop-up/SensorID", params={"deviceTagPath": "OTSE_MFG/Reel/Primary Area/_71_5048_SM611_FS1_SpoolReleaseLocked/parameters" })>

Get rid of the parameters at the end, just pass the path to the UDT instance itself, unless your UDT instance is called parameters? (udt instances have Parameters themselves which is the reason I assumed it wasn't the path to the UDT instance)

It also looks like you're using an expression or property binding and not a tag binding. A property binding will just show the value of the property. In your case, the value in view.params.deviceTagPath is a string, so the binding will return a string.
A direct tag binding will use a path to a tag, a string, to bind to the value of that tag. An indirect tag path let's you build that tag path dynamically be parameterising parts of the path and binding the parts to other values

Hit the pencil icon below your post and format the code blocks using the </> button. It will preserve indentation and apply syntax highlighting.

"An indirect tag path let's you build that tag path dynamically be parameterising parts of the path and binding the parts to other values"

Yes, this is what I was originally trying to do, create an indirect path. However, I am not very good at this and copied another one that worked. This does not seem to point to the path properly though.

Can you screenshot the tags you're trying to read?