on 08-31-2005 10:59 AM
Hi all,
At Design Time we can very easily map Contexts between a View and its component controller.
How to do the same thing at runtime.
That is, if i have a model Node and attribute in the component controller at Design Time, how can i map these to a view controller thru programming.
And Again if i have a model Contexts then how to map model node to the Component controller thru code.
plz help
Rgds,
Vilish
Hi,
Do close the thread if your query is solved and reward points if the answer was helpful. ))
Regards,
Vijith
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Before you do such things, please verify that this is really needed. What is your szenario and why can't you use context mapping at design time?
Remark to terminology: Mapping direction is from view controller to custom/component controller not vice versa.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Do check if this link helps you.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/dy... creating, building, and mapping a context in web dynpro.pdf
It contains the mapping procedure.
Regards,
Vijith
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The link works perfectly fine so please try it again any way here is the code snippet and explanation as in document.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/dy... creating, building, and mapping a context in web dynpro.pdf
To create a context node in the View and then map this context node to the context node of Comp Controller, double click on the View in the project structure and then choose the Implementation tab page.
Enter the following lines of code in the method wdDoInit() , to dynamically create and map the context node. As you can see in the code, you get the nodeinfo of the context node in the Comp Controller, create a node in the view controller and then map this node to the context node of the Comp Controller.
Note that you are using addMappedChild( ) API for creating the context node in the view and not addChild( ). This is because you have to map this node to the context node in the Comp Controller.
In wdDoInit()
//Dynamically create a context node
IWDNodeInfo poNodeInfo = wdThis.wdGetPurchaseOrderCompInterfaceController() .wdGetAPI() .getContext() .getRootNode() .getChildNode("DynamicPurchaseOrder",IWDNode.LEAD_SELECTION) .getNodeInfo();
IWDNodeInfo localNodeInfo =wdThis.wdGetAPI().getContext() .getRootNodeInfo() .addMappedChild("DynamicPO", null, true, false, false, null, false, true);
//Dynamically map the context node
localNodeInfo.setMapping(poNodeInfo, true); localNodeInfo.addAttributesFromDataNode();
Regards,
Vijith
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.