on 06-30-2009 3:11 PM
Hello,
I have a node containing two attributes and another node.
NodeA
Attr1
Attr2
NodeB
Now I have more than one element of NodeA. How do I access the corresponding NodeB of each element?
Thank You,
Motaz
Dear Krishna,
I solved my problem.
Thank You for trying to help
Regards,
Motaz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
Well Marco I saw my where I was going wrong by reading that line of code you posted.
I had been setting the lead selection of NodeB instead of NodeA.
Thank You very much.
And Thank You Saleem for trying to help.
Regards,
Motaz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
By default if you create any node under Root node directly the singleton property of the node will be set to true (you can't modif this). You can create a singleton/ non singleton child node under that node.If you create a singleton node as child node:There will be only one instance for that that node at runtime for all the elements of parent node.
Singleton child node
ParentValueNode
-------------ValueAtt1OfParentValueNode
------------->ChildValueNode(singleton=true)
----------------------->ValueAtt1OfChildValueNode
How to populate the elements of this node:
IPrivateTestView.IParentValueNodeElement parentElement=wdContext.createParentValueNodeElement();
parentElement.setValueAtt1OfParentValueNode("ParentValue1");
//Before this line getting executed the parent node should be initialized by adding atleast one element
IPrivateTestNewView.IChildValueNodeElement childElement=
wdContext.createChildValueNodeElement();
childElement.setValueAtt1OfChildValueNode("ChildValue1");
How to access the elements of this node:
//Before this line getting executed the parent node should be initialized by adding atleast one element
for(int i=0;i<wdContext.nodeChildValueNode.size();i++)
{
wdContext.nodeChildValueNode().getChildValueNodeElementAt(i).getValueAtt1OfChildValueNode();
}
Non singleton child node:
ParentValueNode
-------------ValueAtt1OfParentValueNode
------------->ChildValueNode(singleton=false)
----------------------->ValueAtt1OfChildValueNode
How to populate the elements of this node:
IPrivateTestView.IParentValueNodeElement parentElement=wdContext.createParentValueNodeElement();
parentElement.setValueAtt1OfParentValueNode("ParentValue1");
//Before this line getting executed the parent node should be initialized by adding atleast one element
//Here you can create a seperate node instace for each and every element of parent node element
IPrivateTestNewView.IChildValueNodeElement childElement=
parentElement.nodeChildValueNode().createChildValueNodeElement();
childElement.setValueAtt1OfChildValueNode("ChildValue1");
How to access the elements of this node:
//Before this line getting executed the parent node should be initialized by adding atleast one element
int size=wdContext.currentParentValueNodeElement().nodeChildValueNode().size();
for(int i=0;i<size;i++)
{
wdContext.currentParentValueNodeElement().nodeChildValueNode().getChildValueNodeElementAt(i).getValueAtt1OfChildValueNode();
}
Regards,
Charan
Hi,
Nodes:
By default if you create any node under Root node directly the singleton property of the node will be set to true
(you can't modif this).
If you create a singleton/ non singleton child node under that node.
If you create a singleton node as child node:
There will be only one instance for that that node at runtime for all the elements of parent node.
ParentValueNode
-
ValueAtt1OfParentValueNode
-
>ChildValueNode(singleton=true)
-
>ValueAtt1OfChildValueNode
How to populate the elements of this node:
IPrivateTestView.IParentValueNodeElement parentElement=wdContext.createParentValueNodeElement();
parentElement.setValueAtt1OfParentValueNode("ParentValue1");
//Before this line getting executed the parent node should be initialized by adding atleast one element
IPrivateTestNewView.IChildValueNodeElement childElement=
wdContext.createChildValueNodeElement();
childElement.setValueAtt1OfChildValueNode("ChildValue1");
How to access the elements of this node:
//Before this line getting executed the parent node should be initialized by adding atleast one element
for(int i=0;i<wdContext.nodeChildValueNode.size();i++)
{
wdContext.nodeChildValueNode().getChildValueNodeElementAt(i).getValueAtt1OfChildValueNode();
}
If you create a non singleton node as child node:
There will be a seperate instance for each and every element of parent node element at runtime.
ParentValueNode
-
ValueAtt1OfParentValueNode
-
>ChildValueNode(singleton=false)
-
>ValueAtt1OfChildValueNode
How to populate the elements of this node:
IPrivateTestView.IParentValueNodeElement parentElement=wdContext.createParentValueNodeElement();
parentElement.setValueAtt1OfParentValueNode("ParentValue1");
//Before this line getting executed the parent node should be initialized by adding atleast one element
//Here you can create a seperate node instace for each and every element of parent node element
IPrivateTestNewView.IChildValueNodeElement childElement=
parentElement.nodeChildValueNode().createChildValueNodeElement();
childElement.setValueAtt1OfChildValueNode("ChildValue1");
How to access the elements of this node:
//Before this line getting executed the parent node should be initialized by adding atleast one element
int size=wdContext.currentParentValueNodeElement().nodeChildValueNode().size();
for(int i=0;i<size;i++)
{
wdContext.currentParentValueNodeElement().nodeChildValueNode().getChildValueNodeElementAt(i).getValueAtt1OfChildValueNode();
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Ignore my earlier reply...
Regards,
Saleem
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Marcos,
Node A and B have the same attributes and the sequence is the same.
Regards,
Motaz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Motaz
Can you give more details about your issue?
The Node A and B have the same attributes and values? If yes, the sequence of this attributes are the same or can change?
Regards
Marcos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.