cancel
Showing results for 
Search instead for 
Did you mean: 

External Context Mapping

olivergrande
Associate
Associate
0 Kudos

Hallo,

does someone has experience with external context mapping?

My example terminates with 'cannot create nodes, no mapping defined yet', but I do not know how to create the mapping between the inner and the outer component dynamically.

Thanks,

Oliver

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Oliver,

good documentation and an external context mapping example is available here: http://help.sap.com/saphelp_nw04/helpdata/en/d7/e551cf896c3a49bb87bb4ce38c99c8/content.htm

The documentation describes the scenario, if you know the concrete component implementation of inner component at design time already. If this is not the case and that's what you mean with "dynamic external mapping", you can use a component interface to create the desired implementation component at runtime.

The following sample steps describe how to do that, assuming that all objects reside in the same project (it works with development components also, the procedure is slightly different then):

1. Create an interface (here "InnerIF") at "Web Dynpro Component Interfaces". Add the desired value node(s) and attribute(s) to the interface controller context of InnerIF. Set the "isInputElement" property of the node(s) to true. Add an interface view to InnerIF, if you want to use the inner component(s) visually later. Rename the generated "Default" inbound plug to "FromOuter" for example.

2. Declare a component usage of InnerIF in the outer component. Open the context tab of the Interface Controller of the usage and map the nodes to the corresponding nodes in the outer component (the mapping is exactly the same as described in the sample doc, except the fact that you use the interface instead of the component implementation).

3. Let the necessary inner components implement InnerIF by adding it to the "Implemented Interfaces" of the component interface controllers.

4. For interface component usages you must create and delete an implementation manually. If the implementation is part of the project of the outer component, you can use <i>usage.createComponent(a.b.c.OuterComponent.class.getName())</i>, else you have to specify the deployable object name too: <i>usage.createComponent(a.b.c.OuterComponent.class.getName(), "local/InnerCompProject");</i> for example.

Hope that helps.

Regards,

Stefan