on 08-14-2007 11:12 AM
Hi
Can context mapping be done dynamically? If so can anyone give me a sample code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vidyadhar,
Consider You want to do Dynamic Context Mapping between Component Controller and the View Controller
You can use this kind of code....
In the component controller <b>wddoInit()</b> Method write this piece of code
IWDNodeInfo India = wdContext.getNodeInfo().addChild("India",null,true,true,false,false,false,true,null,null,null);
IWDAttributeInfo City = India.addAttribute("City" , "ddic:com.sap.dictionary.string");
IWDNode NodeIndia = wdContext.getChildNode("India",0);
NodeIndia.getCurrentElement().setAttributeValue("City","Mumbai");
Now create and context map a <b>Node</b> in the <b>View Controller</b>
Write this piece of code in the View controller <b>wddoInit()</b> Method
IWDNodeInfo NodeInfo = wdContext.getNodeInfo().addMappedChild("Bharath",null,true,true,false,null,false,true);
IWDNodeInfo CompNode = wdThis.wdGetDynMapController().wdGetContext().getNodeInfo().getChild("India");
NodeInfo.setMapping(CompNode,true);
IWDAttributeInfo AttInfo = CompNode.getAttribute("City");
IWDAttributeInfo NewAtt = NodeInfo.addMappedAttribute("City",".DynMap.India.City"); //Please Note that DynMap is the Name of the Component, India is the Node and the City is the attibute
IWDNode N1 = wdContext.getChildNode("Bharath",0);
wdComponentAPI.getMessageManager().reportSuccess(N1.getCurrentElement().getAttributeAsText("City"));
When the value is set for an attribute in the Component Controller, you will be able to access it from the View Controller
Regards,
Mathan MP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.