Can bindings be updated dynamically?

Is there a way to dynamically update a series of bindings? What I want to achieve is something similar to a “binding class” that would have a standard definition and be applied to multiple parameters throughout a project, but then could be updated at a later date and have the updates filter down to all of the instances of this binding.

There doesn’t seem to be native way to do this but I was wondering if anyone has found a work around that can get the same result?

TL/DR: No.

A binding is, under the hood, one of several Java objects intimately tied to the window/template/view/page. Or in the case of expressions, a host of Java objects tied together. For designer convenience, the human-compatible form is retained for editing, but the optimized object is what is applied at runtime. The constructs that make a binding editable are found only in the designer.

2 Likes

The answer I was expecting, but hoping not to hear!

If you meant changing a bunch of identical bindings programmatically across multiple components, in the designer and NOT at runtime, you could make scripts to edit your components’ JSON outside of the designer then import them back in.
From your question it seems that’s kind of what you were asking for, only in a hacky workaround way.

2 Likes

I’ve seen people bind some component properties to memory dataset tags so when they update the dataset, all those propereties along the project can change even at runtime, could that be what you’re looking for? I’ve never tried it myself so i can’t attest as to how viable that actually is

1 Like

Yep it doesn’t need to change in run time, I just want the ability to update a series of bindings that modify the class of a component, because conditions that determines what class should be used hasnt been confirmed by the client.

A script that modifies the JSON is a good idea, but how can I access all of the bindings in JSON form without manually copying and pasting the data out of Perspective?

The view.json filew can be found in
(something like)
C:\Program Files\Inductive Automation\Ignition\data\projects\PROJECTNAME\com.inductiveautomation.perspective\views\VIEWNAME/view.json

You can find some inspiration here for a script.

To find the correct props.config you would have to copy it from the view.json file of a tag you made correct (especially if you use transofrm scripts as it needs to be escaping a bunch of characters)

Or maybe with something like this