Entering content frame

Procedure documentation Setting Declarations in the ControlPanel View Controller Locate the document in its SAP Library structure

You need to be able to control the lifetime of the inner Web Dynpro component in the controller of the ControlPanel view and also react to the event triggered by it. To be able to do this, you need to make different declarations: component usage, component interface controller usage, actions, and event handlers.

In addition, a value attribute is declared in the view context in this section (EventParameter).

Procedure

To display the corresponding perspective views for the ControlPanel view in the Web Dynpro tools, in the Web Dynpro Explorer, select the node WebDynpro_Eventing ® Web Dynpro ® Web Dynpro Components ® Embedder ® Views ® ControlPanel.

Declaring Component and Controller Usage

...

       1.      Switch to the Properties perspective view.

       2.      Add the following two entries to the list of Required Controllers by pressing the Add key.

¡        Component usage of the Internal-Web Dynpro-component

¡        Internal component interface controller

This graphic is explained in the accompanying text

This graphic is explained in the accompanying text

The component interface controller must now be included in the usage because – otherwise – the embedding Web Dynpro component would not be able to subscribe to the event defined in it.

Declaring Actions

       3.      Switch to the Actions perspective view.

       4.      Declare the two actions CreateComponent and DestroyComponent. Using these methods, it is possible to control the lifetime of the embedded Web Dynpro component from within the user interface.

Name

Text

Without Validation

Event Handler

CreateComponent

Create Component

This graphic is explained in the accompanying text no

Use Default

DestroyComponent

Destroy Component

This graphic is explained in the accompanying text no

Use Default

Declaring the Event Handler

       5.      Switch to the Methods perspective view.

       6.      Choose the New button and, in the following Wizard screen, select the field Event Handler. Press the Next button.

       7.      Enter the following settings for the new event handler:

Property

Value

Name

reactToComponentEvent

Return type

void

Event source

InternalComponent (Web Dynpro Component Interface Controller) ...

Subscribed event

InnerEvent <InternalInterface – com.sap.tc.webdynpro.tutorials.eventing.internal>

Also select the checkbox Create event handler parameters according to subscribed event.

       8.      Choose Finish to confirm your entries.

Declaring View Context

       9.      Switch to the Context perspectives view.

   10.      Declare the value attribute EventParameter.

Context Attribute

Property

Value

This graphic is explained in the accompanying text EventParameter

type

string

 

The EventParameter value attribute stores the parameter value transmitted by the event.

This graphic is explained in the accompanying text Now continue with Designing the Layout of the ControlPanel View.

 

Leaving content frame