cancel
Showing results for 
Search instead for 
Did you mean: 

Binding 2 Models in the Same component controller

Former Member
0 Kudos

I'm using 2 Import Adaptive RFC Models. I want to bind both the models in the component controller of the same web dynpro component.

But when I try to do model binding for the second model, it does not allow me to do so. If I try to bind the same model in a different project, it happens perfectly and works fine. That means the model i.e. the BAPI is perfectly ok.

Can anyone please tell why is it not allowing to bind 2 models in the component controller of the same web dynpro component?

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Satyadev,

You can definitely bind more than one model in a webdynpro component. There are no such restrictions. I think it should work... Probably if you could send the code snippet, it may help us to trace the problem.

Regards,

Vishnu Prasad Hegde

RenaldWittwer
Contributor
0 Kudos

Yesterday I did the same and it worked fine.

Which version you are using? I am using the Sneak Preview 6.40 SP 4

Best Regards

Renald

Former Member
0 Kudos

Hi Vishnu,

I've two models. in the same web dynpro component. I'm trying to do model binding for these two with two different model nodes in the context of component controller.

Is it not possible to bind more than one model in the same component controller?

Former Member
0 Kudos

Hi Satyadev,

If I undersatand your description properly, you have 2 models nodes in a webdynpro component, and you want to bind these two together. If this is the question, then, yes you cant do the bindings declaralatively, you have to do it dynamically...

Look at the code snippet below, it may help you...

Suppose ChildNode1 and ChildNode2 are the model node in the context of the component controller. Then you can map these two nodes dynamically....

wdContext.wdGetAPI().reset();

IWDNodeInfo testNodeInfo1 = wdThis.wdGetAPI().getContext().getRootNode().getChildNode("ChildNode1", IWDNode.LEAD_SELECTION).getNodeInfo();

IWDNodeInfo testNodeInfo2 = wdThis.wdGetAPI().getContext().getRootNode().getChildNode("ChildNode2", IWDNode.LEAD_SELECTION).getNodeInfo();

testNodeInfo2.setMapping(testNodeInfo1, true);

testNodeInfo2.addAttributesFromDataNode();

Hope this helps,

Please let me know if I have not understood your question properly...

Regards,

Vishnu Prasad Hegde