I have a view called main. I want to refresh a binding on main from a script running in a popup window called my_popup.
The code on a button in my_popup is:
messageType = 'tbl_Refresh_Data'
system.perspective.sendMessage(messageType, scope='page')
Back on my view called main on the root I have a message handler called tbl_Refresh_Data listening in the page scope. The code on the message handler script is:
self.refreshBinding("self.custom.cells")
When I press the button on my_popup I get the gateway error message in the logs:
Error running listCells/main@C/root.onMessageReceived(self, payload): Traceback (most recent call last): File "<function:onMessageReceived>", line 3, in onMessageReceived at com.inductiveautomation.perspective.common.api.PropertyKey.fromString(PropertyKey.java:48) at com.inductiveautomation.perspective.gateway.script.ComponentModelScriptWrapper$SafetyWrapper.refreshBinding(ComponentModelScriptWrapper.java:93) at jdk.internal.reflect.GeneratedMethodAccessor202.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Invalid property key - no scope defined: self.custom.cells
which seems to be telling me that "self.custom.cells" doesn't exist however I picked "self.custom.cells" from the built in binding selector.
Does anyone know what I am doing wrong? I am new to Perspective message handlers so I could be making a mistake somewhere.