Generating custom events

To pass a message from one part of the portal user interface to another part, you can manually generate an event that causes an event handler script in other layouts to execute.

You can set this up by calling an Alert API or by defining a scope, which is a named entity to which listeners can be attached. Scope APIs separate the alert sender from the alert receiver.

Alert APIs are best when an alert is being sent to a specific UI component that is close by in the object model. For example, you may need to send an alert from a grid to its parent component. This requires a simple call to context.AlertParent() in the script.

Scopes are best when passing an alert to multiple components that are not easily accessible, such as nested grids through peer and parent grids. In this case, you could set up a scope at a high level, register the interested components as listeners on that scope, and call context.AlertScope() in the script. By using a scope, you avoid having to set up a chain of alerts, with each layout calling AlertParent() or AlertComponent() to pass the alert along to the final destination.