PowerTable Binding via Script or Indirection Template?

Hello,

I’m curious if it is possible to add bindings to vision components properties via script…i’ve done some digging in the component methods – couldn’t find anything that resembled access to the “PropertyAdapters”

We are looking to populate a powertable with many columns of data with each row to be populated by a UDT instance (while I know we can create something similar via template repeater, I think the powertable representation of the data is more suitable to us (provides built-in filtering, sorting, etc.)

It is not so cumbersome to perform the cell update binding for a single row – but we will have many rows, and the number of rows will require changes with more instances of our UDT being instantiated – it is not practical to update the 10+ cell update bindings per row, each time our UDT list changes.

Ideally, we would hope to have the binding indirection completed automatically, based on a single list/dataset of tag paths.

Any ideas would be greatly appreciated!

Kind Regards,

-Paul

I think I’m part way there… any help would be greatly appreciated…

I believe the heirarchy is as follows:

I believe that I’m able to create “CellUpdateSpec” object correctly – but I am unable to set the “CellUpdateAdapter” to use the new list of CellUpdateSpec objects…

e.g. in my component event script

from com.inductiveautomation.ignition.common.expressions import TagListener
from com.inductiveautomation.factorypmi.application.binding.CellUpdateAdapter import CellUpdateSpec, RowIdentifier
from com.inductiveautomation.factorypmi.application.binding import QueryHolder
from com.inductiveautomation.factorypmi.application.binding.QueryHolder import QueryNode

tag_path = '[default]TEST_TAG'

# set up our tag listener
tl = TagListener()
tl.setTagPath(tag_path)

# add our tag listener to the query node
qn = QueryNode()
qn.setTagListener(tl)

# add our query node to the query holder
qh = QueryHolder()
qh.setNodes([qn])

# create a row identifier -- can match value in a column to return row, or simply by idx
ri = RowIdentifier('Tag_Path','test') # we have a column named "Tag_Path" with a row that has a value of "test" -- I would like to update the value of the "Description" column in this row with our "TEST_TAG" value

# create our cell update spec
cus = CellUpdateSpec(ri, 'Description', qh)


# add this new cell update binding to our component!
cmp = event.source
w = system.gui.getParentWindow(event)
ic = w.getInteractionController() # get the window interaction controller

# grab the correct adapter
for a in ic.getAllAdaptersForTarget(cmp):
    if isinstance(a, CellUpdateAdapter):
		cul = a.getUpdates() # get the list of cell update specs
		a.setUpdates(cul.append(cus)) # update the cell update spec list with our new item
		break #TODO: throws error....perhaps I need to "startup" the tag listener?

Hello,

Were you able to get your script to work?