0

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?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Mr. DMX
  • 653
  • 2
  • 9
  • 20
  • 1
    Welcome to Stack Overflow! I edited your question as far as I could guess your problem. However, add code and description so that more people with knowledge of the subject will see it. Please edit in the specific error-message you're encountering in case that's necessary to identify the specific problem. Good Luck! – Enamul Hassan Aug 06 '16 at 02:50

2 Answers2

0

Exactly! The steps you should preform are:

  1. Create the wrapper method (with the same signature) in the Interface Controller of your Comp1 (embedding) component, and invoke necessary component controller method there

    wdThis.wdGetComp1Controller.doSmth()
    
  2. Add Comp1 to used part of your Comp2 (embedded) component.

  3. Add usage declaration of Interface controller to Comp2 Component Controller in Properties tab.
  4. Now you can be able to access methods of your embedding component (Comp1) like this

    wdThis.wdGetComp1Interface().doSmth();
    
Suncatcher
  • 10,355
  • 10
  • 52
  • 90
0

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.
Mr. DMX
  • 653
  • 2
  • 9
  • 20