Perspective Return Parameters

Hi, I want to refresh a table when a popup is closed upon a particular action. It seems like the best way to do this is to return a parameter from the popup to the main window saying that the action has been performed. I can’t find much information on returning parameters, even though the functionality seems to be there. How would I do this? Thanks in advance.

There is no way to pass parameters from a Popup to any other View, but that doesn’t mean that you can’t do what you want with the Message Handling used by Perspective.

Please keep in mind that “parameters” are passed arguments meant to be used to construct something (like a View or a Popup - which is just a fancy word for “View which is detached from the Page”). Due to some quirks, parameters can have their values changed at runtime, but even bidirectional parameters can’t be used to communicate back and forth in all instances (Popups and Docked Views can be created with parameters, but once they’re created there is no back-and-forth communication with their parameter values).

To do what you want:

  • Decide on the action/condition you would like to trigger a refresh of your Table’s data.
  • When that action takes place or the condition is met, use
system.perspective.sendMessage(messageType='TABLEREFRESH', payload={}, scope='page')
  • Now go to your Table and right-click it.
  • Select “Configure Scripts”.
  • Under Message Handlers, double-click “Add handler…”
  • In the Message Type input field, supply “TABLEREFRESH”.
  • Leave the Listen Scope of Page selected, as that is wat we specified in the supplied sendMessage function.
  • Set the script text to be self.refreshBinding('props.data').