cancel
Showing results for 
Search instead for 
Did you mean: 

Conext Mapping between Views in different components

Former Member
0 Kudos

Hi All,

I have a 1 project and 1 Application associated to it. Now, I have two components A and B. Each controller has its view component A has View VA and component B has View VB.

VA has a input field Name and the value entered in VA should be displayed in VB.

This is can be easily achieved if both VA and VB are in the same component using context mappings.

Can someone please tell me as to how I could achieve this where VA and VB are in different components using context mappings or any other alternative.

Thanks in advance.

Best regards,

Divya

Accepted Solutions (0)

Answers (2)

Answers (2)

vijayakhanna_raman
Active Contributor
0 Kudos

Hi Divya

If 2 components are there in application,their values can be transferred both by context mapping and event handling.

1)Event Handling:(Let VA is Receiving the data from VB)

i.Let VB can be used by the VA (i.e.,embedded) in the used component of VA. The interface controller of VB will be available to the VA if declared as the used component.

ii.Declare a event(NameEvent) and a method (intefacemethod)in the interface controller of the VB.

iii.Pass the value of VB to the method of interface controller.(i.e)wdThis.wdGetintefaceController().intefacemethod(name);

iv.This method in interface controller will fire the event to VA (i.e)wdThis.wdFireEventNameEvent(Toname);.

v. Create the event handler in VA and handle the event in VA.

2)Context mapping:(Passing Values From VA to VB)

External mapping is possible by mapping view controller of VA to the interface controller of VB. Then it is mapped to the view controller of VA.

Regards

Vijayakhanna Raman

Former Member
0 Kudos

Hi Divya,

When you have two components then you will have to use the component interface controller.

The below link has in detail the process doing inter component communication.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tu... on server-side eventing - 14.htm

I think this will help you.

regards,

Mahesh