Perspective Table refresh button in separate views

Hi. I believe I made a mistake, hoping I didn't.

I have a main view that has 2 embedded views in it. 1 view has a refresh button. The other view has a perspective table that is tied to a SQL Query.

I need to refresh the table in view 2 when the button is clicked in view 1. From what I have read thus far in another topic, this can not be done. That seems a little odd considering how powerful Perspective is.

I did this in another view where the button and table were NOT embedded views by using "self.getSibling("AlarmTable").refreshBinding("props.data")"

But now I have 2 embedded views in a main view and I don't think this can be done.

Any insight would be greatly appreciated.

Thank you

That's a perfect use case for message handlers. In your example, you can configure a message handler in view 2 (containing the table) that will refresh the binding on the table's prop.data property when the message handler is called. The scope on this would need to be set to page. In view 1, use the system.perspective.sendMessage() function on the button to call the message handler in view 2.

3 Likes

Thank you very much. That worked very well. Greatly appreciated.