javamodel-view-controllercontrollernetweaverwebdynpro

Call parent component method in Web Dynpro Java


I'm working with two Web Dynpro Java components (SAP NetWeaver Developer Studio 7.0), where the first component is embedding another one and using it in a pop-up window.

The embedded component has a method triggered on a button click, after this method execution I need to call an embedding component method.

Should I use the Web Dynpro Component Interface to call the embedding component method?


Solution

  • The problem was solved this way:

    The embedded component has a button which is going to trigger an Interface Controller event.

    1. On the component we are using as embedded component, we are going to create an Interface Controller event, this event is going to be catched by the parent component method.
    2. Add the embedded component to the parent component on the "DC MetaData > DC Definition > Used DCs" section.
    3. Then add it to the "Used Web Dynpro Components"
    4. At the parent component, open the diagram view of the Web Dynpro Component and add a relationship going from the ComponentController to the Used Web Dynpro Component.
    5. At the parent ComponentController, add an Event Handler in the method's section, select the Web Dynpro component as source of the event and the event that the parent component will be catching in the new method.