cancel
Showing results for 
Search instead for 
Did you mean: 

External mapping contect

emmanuel_turci
Advisor
Advisor
0 Kudos

Hi All,

I tried to find a solution myself reading all posts and some document from help, like the external mapping context but without success until now.

So please, could you help me to find right solution ?

1/ Idea is that a comp A uses (used component) comp B.

2/ In interface controller context B I defined a node BNode with attributes. Same thing of course in controller context B.

Both with "Input element" set to true and Collection Cardinality set to 1..1

3/ In controller context A I mapped using the context from B the node BNode.

4/ Finally I try into controller B, java part, to put some data into BNode.

First of all this the BNode current element is null (as I don't understand because of my cardinality set to 1..1)

So I try to create a node element and to add it into my context, exception occurs :

com.sap.tc.webdynpro.progmodel.context.ContextException: NodeInfo(path=_.CompB.BNode, class=com.sap.tc.webdynpro.progmodel.context.MappedNodeInfo): cannot create nodes, no mapping defined yet

Do you have any idea ?

Thanks for any help

Best regards,

Emmanuel.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

These are the lines extracted from the documentation

<i>Restriction

Note that context attributes cannot be defined as “can be mapped externally later“ isInputElement = true directly below the root node (top level context attribute) in the component interface content. External context mapping is possible only for those context attributes that belong to independent or dependent context nodes.</i>

So, set isInputElement = false and change the cardinality to 0:1 and create an instance of the node before setting the values to its attributes.

Bala

emmanuel_turci
Advisor
Advisor
0 Kudos

Hi Bala,

And thanks for your reply.

Ok so first, I don't understand the restriction because in my context I didn't put directly attributes but first a node BNode and then attributes into this node. So I thought that it was in that case possible...

Nevertheless I tried of course what you said. So in B I changed the input element value to false, and the cardinality to 0..1 in both controller and interface controller of B.

Then in B, I create this element and set some attributes.

But in A, If I want to use the BNode node with attributes mapped to comp B, it is impossible because this BNode in comp A is still empty. It is why I would like to use input element set to true to be able to acess to these external attributes.

Next try perhaps :).

Best regards,

Emmanuel.

emmanuel_turci
Advisor
Advisor
0 Kudos

Hi all,

ok in fact I found the problem, it was related to a third component, comp C, that used also the external mapping only on one attribute from the mapped node. But you cannot mapped only one attribute without the parent node.

As soon as the parent node itself is mapped then you can have access to the corresponding attribute.

I hope it is clear enough ... otherwise juste send me an email.

Emmanuel.

emmanuel_turci
Advisor
Advisor
0 Kudos

Hi all again,

In fact I said victory to earlier.

In fact to come back to my problem, I get now this exception :

initializeContext : Node(_.compB.BNode, class=....context.wdp.IPublicCompB$IBNode): no active node to map to

Thanks for your help,

Best regards,

Emmanuel.

Message was edited by: Emmanuel Turci

Former Member
0 Kudos

Hello,

Your exact requirement has been dealt with in this <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/e8d7cd90-0201-0010-4a8c-dd22fa16ca0a">tutorial</a>. You may also try to pass values through eventing as explained in the same material.

Bala

emmanuel_turci
Advisor
Advisor
0 Kudos

Hi Bala,

and thanks for your answer.

in fact I found the problem last week.

I forgot to use the enterReferencing mode using the appropriate method between both components used.

So thanks to Uwe Reeder the method to use was :

..ComponentUsage().enterReferencingMode(ref of the corresponding component to use)

in that case you are sure that this instance you are using is the same and not a new one.

Answers (0)