Show TOC Start of Content Area

Procedure documentation Using the Template for Portal Eventing  Locate the document in its SAP Library structure

If a Web Dynpro application was integrated in the SAP Enterprise Portal using the Portal iView wizard, it can be the starting point for navigation to other Web Dynpro or non-Web-Dynpro applications. The template for Portal eventing supports you when subscribing to an event and when implementing the source code for triggering an event.

Prerequisites

You have completed all steps described under View Templates. You have created the view for which the Portal eventing is to be implemented. Furthermore, you must have created all relevant context nodes and attributes in the Controller/Context Editor. The attributes required for the template must be of the type String.

Procedure

       1.      Choose Next. In the next window, you specify the activity – that is, whether you want to subscribe to an event (radio button 1) or trigger an event (radio button 2).

       2.      In the first case you select Subscribe to an event, while in the second case you select Fire an event; you then enter a namespace and a name for the subscription. Choose Next.

                            a.      Subscription

                                                  i.       In the next window, select the action that is to be executed when the event is triggered. If no action exists that you want to use, you can create a new action by choosing New. You can also define an outbound plug in the action wizard.

                                                ii.       If required, set the flag to fill the view context attribute with event data.

                                               iii.       Choose Next to continue and then select a method into which to insert the event code. If no suitable method exists, you can create a new method or event handler in the same window.

                                               iv.       You also have the option of implementing the code for the unsubscription. Choose a method for this, or create a new one. Close the wizard by choosing Finish.

                            b.      Triggering an event

                                                  i.       If you activated the flag under point 3aii above, you can use an event to publish the context attribute that contains the event data. Select the relevant attribute in the next window and choose Next.

                                                ii.       Choose a method, or create a new one, whose source code is to contain the event code. You can choose from the methods wdDoInit and wdDoExit, or you can use a method you defined yourself.

                                               iii.       Close the wizard by choosing Finish.

       3.      Save your changes by choosing This graphic is explained in the accompanying textSave all Metadata.

Result

The following source code is added to the relevant, selected method of the view context:

//@@begin wdDoModifyView

if {

   WDPortalEventing.fire(

     "<myNamespace>",

     "<myName>",

     wdContext.current<myContextNode>Element().get<myContextAttribute>());

     }

//@@end

 

End of Content Area