Alerts

This event occurs as a result of the various Alert API calls available to the scripting.

For example, the AlertComponent() method may be called by the scripting to alert an embedded web page to a new situation. In this case, all the layouts on that embedded web page receive the Alert event.

These alert APIs exist on both the server and client:

context.Handlers.RegisterAlertHandler(OnAlert)

context.Handlers.UnrRegisterAlertHandler()

The client-side alert handler is always called first, followed by the server-side handler. This is true even when the alert was sent from server scripting.

If there is no work that needs to be done on the server side, the following call should be made in the client-side handler to prevent passing the alert to the server side, as this avoids unneeded round trips from client to server.

parms.StopServerSideHandler(true)

When the component receiving the alert is not rendered (Rendered? = false), the alert handler for that component will not run. There is an exception to this case for AlertComponentFilterChanged(). See AlertComponentFilterChanged.

Further, when a script event handler changes the field display format (FDF) of a component or sets a component to Rendered? = true, this is a request to make this change. So any subsequent calls to send alerts in this same event handler are going to see the original value of the FDF or rendered. For example, say in some layout, a component has Rendered? = false. Then in some client-side event handler, this component is set to Rendered? = true followed by an AlertComponent() to the same component. In this case, the AlertComponent()will be dropped and not processed by the component. To get information to a component as it is rendering, use AlertComponentFilterChanged().