on 08-22-2007 10:16 AM
Hi Experts
I had created one Context Dynamically in wdDoInit() method in The View Controller.
Can anyone tell me how to add the values dynamically to that dynamically created Context.
Regards
Chandran S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi chandran..
You can do this by the following..
In the component controller wddoInit() 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 Node in the View Controller
Write this piece of code in the View controller wddoInit() 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
Hope this will help you..
Urs GS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
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.