cancel
Showing results for 
Search instead for 
Did you mean: 

component to component communication

Former Member
0 Kudos

Hi

i have aDC with two components comp1 and comp2 i want to call amethod present in comp1 from comp2,can you please tell me how to do it.

thanks

rahul

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

HI rahul

Please check this PDF link

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60132577-7801-2b10-c9b1-b13b2f78...

Hope it will help you

Regards

Ruturaj

Former Member
0 Kudos

Hi,

Declare comp1 as a used component in comp2.Add the interface controller comp1 to comp2.then call the bethod

wdThis.wdget<interfacecontroller comp1>.methodname();

Former Member
0 Kudos
Former Member
0 Kudos

Hi,

Add comp1 as used Webdynpro component in comp2. By this, you can see the interfacecontroller of comp1 in comp2.

1) Add a method in interface controller of comp1 to call method of comp controller of comp1.

2) LInk the inteface controller of comp1(used Comp) with comp2 in Diagramview of Comp2.

3) call the method from comp2 controller as

wdThis.wdgetcomp1Interfacecontroller().method();

By this you can have only one way communication, like you can call comp1 from comp2, but you can not call comp2 from comp2. But the above method may solve your requirement.

If you want two communication you need to use Component Interface Definition, for this see the below doc

[https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0409d83-5ed5-2910-ef91-e41da6d5b8b4]

Regards

Raghu

Former Member
0 Kudos

Hi,

I have done the below steps as mentioned :

1. Defined used component comp1 in comp2

2. linkd the interface controller of comp1 in comp2

and 3. calling the method : wdThis.wdgetFlexInterface().refreshFlexcomp() ; This refresh Flex comp() is existing in comp1 interface controller.

This looks fine with no compile errors in test server. When I try to activate to D using NWDI then it is returning compile error as below:

symbol : method wdGetFlexInterface ()

[javac] location: interface com.deloitte.component.newhire.healthplan.wdp.IPrivateNew_Hire_HealthPlan

[javac] wdThis.wdGetFlexInterface().refreshFlexComp();

[javac] ^

[javac] Note: Some input files use or override a deprecated API.

[javac] Note: Recompile with -deprecation for details.

[javac] 1 error

Can you please let me know if I am missing anything here?

Thanks for your time!!

Regards,

Madhavi

former_member192434
Active Contributor
0 Kudos
Former Member
0 Kudos

Hi Rahul,

You can achieve this by using Component Interface Definition.

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0409d83-5ed5-2910-ef91-e41da6d5...

and also find blog on Component Interface Definition

/people/bertram.ganz/blog/2007/01/19/new-web-dynpro-java-tutorial--component-interface-definitions-in-practice

former_member201361
Active Contributor
0 Kudos

Hi Rahul,

refer this blogs ,

[https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/8748] [original link is broken] [original link is broken] [original link is broken];

[https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/8881] [original link is broken] [original link is broken] [original link is broken];

Thanks and regards