!--a11y-->
Setting Declarations in the
ControlPanel View Controller 
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).
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.
...
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


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.
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 |
|
Use Default |
DestroyComponent |
Destroy Component |
|
Use Default |
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.
9. Switch to the Context perspectives view.
10. Declare the value attribute EventParameter.
Context Attribute |
Property |
Value |
|
type |
string |
The EventParameter value attribute stores the parameter value transmitted by the event.
Now continue with Designing the Layout
of the ControlPanel View.
