Triggering a Portal Event

Use

A portal event is an event that is triggered within an iView (in this case, within a Web Dynpro application) and then passed by the portal to one or several other iViews. The portal passes the event to all iViews that have registered for this event. In this way, events can be transported between several iViews based on different development techniques.

In Web Dynpro ABAP, the portal manager (interface IF_WD_PORTAL_INTEGRATION) provides the FIRE method. Using the Web Dynpro Code Wizard, you can insert this method call as a template into your source code and fill it with values in accordance with the requirements of your application.

In addition to the mandatory parameters Namespace and Name, you can also pass on another parameter and a scope:

Namespace in which the event is stored

'PORTAL_EVENT_NAMESPACE'

Event Name

'PORTAL_EVENT_NAME'

Parameter

'PORTAL_EVENT_PARAMETER'

Scope of Application

PORTAL_EVENT_SCOPE

You can use the scope to determine which browser window the event is forwarded to:

IF_WD_PORTAL_INTEGRATION=>CO_EVENT_SCOPE-CURRENT_WINDOW

Event is only forwarded within the current browser window

IF_WD_PORTAL_INTEGRATION=>CO_EVENT_SCOPE-CHILD_TO_PARENTS

Event is forwarded to all superordinate browser windows but not within the current browser window

IF_WD_PORTAL_INTEGRATION=>CO_EVENT_SCOPE-CURRENT_WINDOW_AND_PARENTS

Event is forwarded to all superordinate browser windows and within the current browser window

You can trigger such a portal event from anywhere in your Web Dynpro application. The event is sent with the next response to the client. You can even trigger several portal events in one request-response cycle.

However, it is usual to trigger a portal event in an action handler of a Web Dynpro application. This could be the case, for example, with an action handler of a UI element (for example, a button). When a portal event is triggered, an internal application event is first passed from the iView to the portal and can e handled within one or several other iViews.

Syntax for Namespace and Names of Events

The characters permitted for the namespace and event name are restricted to the namespaces of the SAP Enterprise Portal -Client Framework.

You can only use the characters listed in the table below.

Valid Characters

Uppercase letters

"A" - "Z"

Lowercase letters

"a" - "z"

Numbers

"0" - "9"

Special characters

"-" "_" "."

Also note the following:

The namespace must begin with the character string urn:

The namespaces com.sapportals.portal.* and com.sapportals.* are reserved for SAP, and therefore you should not use them for your applications.

Note that the namespace and the name are both case-sensitive.

Example

  • You can find examples in the Web Dynpro applications in the system: WDR_TEST_PORTAL_EVENT_FIRE

    Trigger event

  • WDR_TEST_PORTAL_EVENT_FIRE2

    This application serves as a test application. You can enter the name of an event from your own application in order to test the event separately.