on 08-10-2005 8:15 AM
Hello All,
I am trying to create Dynamic View Context Nodes in webDynPro. I used the tutorial <i><b>"Dynamic Programming in Web DynPro"</b></i>.
<b>The code for creating new node (in the tutorial) is:</b>
IWDNodeInfo node= wdContext.getNodeInfo().<b>addChild</b>("DynamicNode",null,true,true,false,false,false,true,null,null,null);
This method is <b>deprecated</b> and somehow i was able to use new method as:
IWDNodeInfo node = wdContext.getNodeInfo().<b>addChild</b>("DynamicNode",null, true,CMICardinality.ONE_TO_MANY,CMICardinality.ONE_TO_MANY, false, null);
<b>For Creating a dynamic Attribute:</b>
IWDAttributeInfo fieldName = schemaNode.addAttribute("AttrID","com.sap.dictionary.string");
I am confused in using this code and have the <b>following questions..</b>
<b>Q1.</b> What is the difference between <b>IWDNodeInfo</b> and <b>IWDNode</b> ?
<b>Q2.</b> Are we creating actual Context nodes here ?
<b>Q3.</b> What is the difference between <b>Context Nodes</b> and <b>Context Elements</b> ? [ As of now i visualize Context Node as to define basic structure of context and context element to hold actual values.]
Please reply soon...:-(
Regards,
Aayush
Hi,
Q1: IWDNodeInfo is metadata (description of data), IWDNode is a list of actual data
Q2: Yes and no. You are creating metadata. But WD automatically creates data based on this definition for you.
Q3: context Node is a list of context NodeElements
What SP are you using? This method in not deprecated even in NW04s.
P.S. "List" here is not java.util.List, but just logical term to define ordered set of entries with the same type.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
This is how you create the context node.
IWDNodeInfo node= wdContext.getNodeInfo().addChild("DynamicNode",null,true,true,false,false,false,true,null,null,null);
To get a handle of that node we generally use
wdContext.node<name>;
And you cant typecast nodeinfo to node.What do you want to do.
Tel us the requirement !
Regards
Bharathwaj
To explain Bharathwaj answer:
1. You have one node always available, it is exposed via wdContext variable (the root).
2. If you not creating nodes dynamically but using designer instead, WD generates you handful methods to access sub-nodes: say, wdContext.nodeEmployees(), wdContext.currenEmployeesElement().nodeProjects()...
3. If you are creating nodes dynamically at run-time these methods are not generated, and you have to access nodes in dynamic way:
final IWDNodeInfo niEmployees = wdContext.getNodeInfo().addChild("Employee", /*..*/);
final IWDNode nEmployees = wdContext.getChild(niEmployees.getName(), IWDNode.LEAD_SELECTIOn);
VS
Hello All,
How do i create an Attribute to the dynamically created Node ?
I tried using code:
<b>IWDAttributeInfo fieldName = myNode.addAttribute("Attr0",
"com.sap.dictionary.string");</b>
But not sure whether it creates <b>Attribute</b> of <b>AttributeInfo</b> ..
Please explain IWDAttribute.
Regards,
Aayush
Hi,
If there is a attribute it will have an attribute info .
You cant create attributeinfo.
Addattribute will add an attribute!
Go to NDS help and check.It will have all the details .
When you say ctrl+space and get a function the help related to the function comes as a tooltip.
Message was edited by: Bharathwaj R
Hi,
Try with wdContext.getChildNode();
or
wdContext.getNodeInfo().getChild("");
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
Q1. What is the difference between IWDNodeInfo and IWDNode ?
Nodeinfo gives the metadata information of the node like cardinality ,selection property etc.,
Node actually creates a structure and adds attributes to it which can store values.
Q2. Are we creating actual Context nodes here ?
Yes ,You are.
3. What is the difference between Context Nodes and Context Elements ?
ya you are right ! Context nodes just hold a list of elements with the structure defined by you. The values for each elements is stored in its attributes
Regards
Bharathwaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
1. The metadata information of the controller context is represented at runtime in the objects of the types IWDNodeInfo and IWDAttributeInfo.
2.yes
3.Please refer to this for details
http://help.sap.com/saphelp_nw04/helpdata/en/76/98384162316532e10000000a1550b0/frameset.htm
regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.