Calling custom methods from a different view without messages

I am trying to determine the most effective way to call a custom method on a main view from a popup opened by a button on the main view. Since the popup is a different view than the main view I am unable to directly reference the custom method using getParent() in the scripts on the popup.

Currently I have the popup send a message at session scope and then call the custom method in the message handler on the main view. I am wondering if there is a better way to do this, ie. is it possible to call the custom method from the popup if I pass the view ID in as a parameter.

Messaging is the right answer. Consider using page scope instead of session scope.

1 Like