refreshBinding not working probably because not called on the right object

I’ve got a table whose data are based on a date field, so i created a binding on it.
There is also a button that adds a new row, so that when pressed I want to requery the table.
image
I tried with the following line of code in the button click event:

system.db.runPrepUpdate("INSERT INTO MYTABLE (COL1) VALUES (?)",[myNewData])
self.getSibling("lblDate").refreshBindings("props.value")

But it doesn’t work with the error:

org.python.core.PyException: AttributeError: 'com.inductiveautomation.perspective.gateway.script' 
object has no attribute 'refreshBindings'

Any idea?
Thanks in advance

You should be refreshing the table binding - not the lblDate binding.

1 Like

Refreshing the table binding? It makes sense.
So I tried this:

self.getSibling("Table").refreshBindings("props.data")

Same error:

AttributeError: 'com.inductiveautomation.perspective.gateway.script' object has no attribute 'refreshBindings'

It isn’t refreshBindings. There is no “s”

self.getSibling("Table").refreshBinding("props.data")
2 Likes

Same error but i have currectly wrote the script
i want to add a refresh button and in mouse clicked i want the table to refresh itself

You need to show us what you have done.


in this picture i have scripted in the refresh icon the code mentioned above

  1. Show us your script? How can we see the problem if you do not? See Wiki - how to post code on this forum.
  2. What is the name of the Table component? (That will be needed in the script.)
  3. Did you fix the error?
    self.getSibling("Table").refreshBinding("props.data") ← Correct.
    self.getSibling("Table").refreshBindings("props.data") ← Wrong.

def runAction(self, event):
self.getSibling("Table").refreshBinding("props.data")

what is the props means in this context

  • The binding is what generates the table data.
  • The refreshBinding causes it to recalculate the binding.

so what should i do any help is welcomed

Correct the reference component path using the Browser on the right

1 Like

thanks a lot it worked

I have a button that I am using to refresh a table in the same view. I get this error:

AttributeError: 'NoneType' object has no attribute 'refreshBinding'

def runAction(self, event):
    self.getSibling("ProductionTable").refreshBinding("props.data")
self.getSibling("ProductionTable")

Is returning NoneType

So either, the component which you have this script on does not have a sibling named ProductionTable or you have mispelled it. Use the property browser in script editor to get the correct path to the component that you are trying to refresh the binding on.

I used a message to refresh the table from a button the user clicked to submit the original data.