on 05-06-2008 10:54 PM
Hello All,
I have a context node:
Context
|__MyValueNode (0..N, singleton = true)
....|__MyChildValueNode (0..N, singleton = true)
....|__MyValueAttribute
(The .... is just to position things properly).
I was wondering how to take a newly created MyChildValueNode and add it to MyValueNode.
Thanks for your help.
Mike
Edited by: Mike Yang on May 6, 2008 5:58 PM
Hi Mike,
As per your inputs, there is one parent node named MyValueNode and child node named MyChildValueNode.To create a new child node,follow the steps mentioned below:
Step 1: First create the element of parent node as
IMyValueNodeElement objMyValueNode=wdContext.nodeMyValueNode().createMyValuNodeElement();
Step 2. Bind this element to node as
wdContext.nodeMyValueNode().add(objMyValueNode);
Step 3 .Now create elemet of child node as
IMyChildValueNodeElement objMyChildValueNode=wdContext.nodeMyChildValueNode().createMyChildValueNodeElement();
Step 4. Bind this element to node as
wdContext.nodeMyChildValueNode().add(objMyChildValueNode);
regards,
amit bagati
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For future reference, SAP has a tutorial for this:
Cheers,
Mike
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Context
|__MyValueNode (0..N, singleton = true)
....|__MyChildValueNode (0..N, singleton = true)
....|__MyValueAttribute
When creating element, we gives the exact node element. In fact, this is Context at design time and at runtime its behavior is deferent.
e.g:
IPrivate<Comp_Name>.IMyChildValueNodeElement element;
will create type of MyChildValueNode
element = wdContext.createMyChildValueNodeElement();
And you can add this one to MyChildValueNode only
wdContext.nodeMyChildValueNode().addElement( element);
You can access the attributes using the nodeElement references
element.getMyChildValueAttribute();
wdContext.currentMyChildValueNode().getMyChildValueAttribute();
if you want parent attribute
wdContext.currentMyValueNode().getMyValueAttribute();
nikhiL
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
IPublic<component name>.IMyValueNode element = wdContext.nodeMyValueNode().createMyValueNodeElement();
IPublic<component name>.IMyChildValueNode child = wdContext.nodeMyChildValueNode().createMyChildValueNodeElement();
element.nodeMyChildValueNode().add(child);
wdContext.nodeMyValueNode().add(element);
Regards,
Murtuza
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 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.