Show TOC Start of Content Area

Procedure documentation Subscribing to Events with Web Dynpro  Locate the document in its SAP Library structure

A Web Dynpro application can subscribe to an event using a MessageBasedTrigger UI element, an invisible element that listens for RTMF events.

With the MessageBasedTrigger, you specify the following information:

      The name of the event to which you want to subscribe

      The name of the Web Dynpro action to be triggered when the event is received

Procedure

...

       1.      Create the action to be triggered when the event is published.

If you want to get the message parameters for the event, add a WDMBTParameters parameter to the action.

Note

You cannot retrieve the RTMFMessage object for the event. You can only receive a map of the parameters.

       2.      Add a MessageBasedTrigger UI element to the view that is to receive the event.

This graphic is explained in the accompanying text

       3.      For the MessageBasedTrigger, set the following properties:

¡        eventName: The name of the event to which you want to subscribe

¡        onAction: The name of the Web Dynpro action to be triggered when the event is received

       4.       If you added an action parameter to receive the RTMF event parameters, map the parameterMap parameter of the onAction event of the MessageBasedTrigger to the WDMBTParameters parameter that you added to the action.

This graphic is explained in the accompanying text

Retrieving Parameters

If the message sent with an event contains custom parameters, these are passed into the Web Dynpro action that is triggered.

Note

You must map the parameterMapparameter of the onAction event of the MessageBasedTrigger to a WDMBTParameters parameter of the Web Dynpro action.

You can use the following methods on the WDMBTParameters object to retrieve parameter values:

      params.getParameterKeys(): Returns a String array of parameter keys.

      params.getSingleValue("ParameterName"): Returns the String value of a parameter that contains a single value.

      getMultipleValues("ParameterName"): Returns a String array of values of a parameter that contains multiple values.

Note

You cannot retrieve the predefined parameters for the event's message. For information about predefined parameters, see Setting/Getting Parameters.

End of Content Area