cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping one node to many nodes

Former Member
0 Kudos

How do you map one node in a controller context to many other nodes in another controller context?

Here's the situation I'd be using this.

I have an Adaptive RFC model from which I created a Custom Controller. I then used the wizard to map to the model.

The model corresponds to RFC functions and many of those functions accept the same parameters, LanID for instance. I simply want to have one "LanID" node in a controller that I would set. The change would then propagate to the other LanID context nodes in the Custom Controller mapped to the model.

What's the best way to handle this?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Bernard,

I'm not sure exactly what you are attempting, but when you have mapped nodes (or attributes), there is only ONE version of the data, which all the nodes use. So if you change attribute data in ANY context, all the nodes/attributes which are mapped to this, immediately see the new data. It doesn't matter if you "set" the data of the original attribute, or any of the mapped attribtutes. The end result is the same.

Regards,

Walter

Former Member
0 Kudos

Hi Walter, I understand the mapping concept.

What I'm trying to do is this.

I have attributes B1, B2 and B3 in the context of a custom controller. I would like them to all take the same value as attribute A1 in another controller so that when A1 changes, B1, B2 and B3 all take that value as well.

I believe it isn't possible to create this "one to many" mapping using the context editor. I need to edit the source code and manually bind these nodes. Is this the best way? If so, I'd appreciate any code to start me up.

Former Member
0 Kudos

If I understand correctly.. B1, B2 and B3 are all in the SAME custom controller? Even if they are, I don't see a problem of mapping them all to A1 which is in another controller. Let's say that A1 is the "original" node, and B1, B2 and B3 are the "mapped" nodes.

If you require that B1, B2 and B3 are "original" nodes, and A1 is the "mapped" node, then this is scenario is impossible.

If you can be more specific, I will try to answer your question better.

Walter

Former Member
0 Kudos

Yes, it's the first scenario you mention. A1 is the "original" node and any change to it gets propagated to the B nodes.

Former Member
0 Kudos

OK, so this shouldn't be a problem.

Former Member
0 Kudos

Walter, I'm asking how this is done.

Code snippets would help me here, something with bind() in it I assume.

Former Member
0 Kudos

Hi Bernard,

Use the Data Modeler of your Custom Controller and link the various controllers. Needless to say, you have to create the link from Target Component to Source Component.

Apart from this you dont need to write any code for transfering data as its taken care by WebDynpro.

Regards,

Shubham

Former Member
0 Kudos

The problem is that the "Edit Context Mapping" dialog doesn't allow us to do "one to many" mappings. That is, you can't connect a node on the left to more than one node on the right.

Former Member
0 Kudos

I've just found that someone else asked the same question here.

In that thread, Marcin Galczynski answered that it has to be done through coding. He even puts in a bit of code which didn't work after a quick test. I'll try again.

Former Member
0 Kudos

Found it. The Relate Context Attribute wizard is what I was looking for. The dialog allows the mapping between one node from one controller to many in another controller. It even generates the binding code. This wizard if found in the Data Modeler, right clicking on a controller and selecting "Apply Template".