How to Expose the Tag Path of a Component Binding

Is it possible to expose the tag path of a tag that a window component is bound to?

For example, if the Value property of a Numeric Label component on a screen is bound to the value of a tag, is it possible to expose that tag path into a script?

I’d like to be able to click on the screen component at run time and have the script retrieve the tag path and use that in a script.

Thanks.

Bindings are stored in each window’s InteractionController in a list of PropertyAdapters. These aren’t documented, so you won’t be able to get support on this, but you can introspect these property adapters to find the tag paths you need.

Phil, thanks for the info. That sounds like exactly what I’m looking for. How do I access the InteractionControllers ? Thanks for your help.

The SDK documentation will get you much of the way. Start with the JavaDoc for the window class FPMIWindow. Note its method getInteractionController(). With that, you can use the InteractionController’s methods to explore the bindings in the window. You’ll probably want to just get a specific component’s binding on a specific property, using getPropertyAdapter(). Note that PropertyAdapter is an interface, not a class – you’ll have to verify that the binding you are looking at actually references a tag. Or just wrap that part of your script in try: … except:

2 Likes

Can I use your method in Perspective???
I found this Finding Tags used in Bindings,
and IA developer said that you know many interesting things! And then I thought you can help.

None of that stuff applies to Perspective. And to be honest, I haven’t even tried, since the bindings are in the view’s json on disk.

You think, doesn`t work it in perspective? How I can find tag in the project(window) in Runtime?

It can't possibly work as-is, as all of those classes are Vision-specific. For Perspective:

:man_shrugging:

it’s a pity! I hoped , that someone can help me. But thank you very much behind your comment. Now I understood, that can search answer in another direction…

It's only been 2 hours since you posted your question, can you maybe wait a little longer in hopes that someone else can help you? If you don't hear back after a day or two, bump the thread. You can also contact IA support.

Not for help hacking into undocumented internals :slight_smile:

@Andrii.Randiuk a good place to start would be a new topic explaining what you're trying to accomplish and why. Maybe somebody can help you, and maybe it won't involve any kind of digging into undocumented internal APIs.

For his original question @Kevin.Herron

I created new topic Search function in perspective

I am curious to get tag binding to a property. Following your path here and reading JavaDoc, I can get this. but when I print, its none. The binding is Direct Tag Reference.