on 01-14-2008 9:39 AM
hi All
i hav another query for you regarding the manipulation of table.
how do v get the currentcontextelement since the node table refering to is at 3rd level e.g.
parent--
child1--
-
child2---
-
attribute1
-
attribute2
now way m getting current value for attribute1 is as follwos
IWDNode parent=wdContext.nodeParent.currentParentNodeElement.node();
child1=parent.getchild("child1",parent.getLeadselection());
child2=child1.getchild("child2",parent.getLeadselection());
attribute1 = child2.getCurrentElement().getAttributeAsText("attribute1");
is there any other simpler way for this????
Thanks
Deeps
Hi,
You can directly get the child attribute as
wdContext.currentAttribute();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It depends on what you want to access. When using wdContext.current<Node>Element(), the path from the root element to the node is followed along the lead-selection of all intermediate nodes.
But sometimes you want to access for example the lead-selection in a child node whose parent element is not lead-selected. And in that case you have to do it differently.
Armin
Are any nodes in this structure non-singleton? Do you really want to access the node element of "child2" following the lead-selection-path from the root?
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Following line will always return you the selected Element for the corresponding Node.
IWDNodeElement selectedElem=wdContext.current<Node Name>Element();
Regards,
Praveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can access it using:
wdContext.nodeChild2().currentChild2Element().getattribute1();
wdContext.nodeChild2().currentChild2Element().getattribute2();
I mean to say that you can directly access the child nodes using the above code. You dont need to go from the parent node.
thanks & regards,
Manoj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Deepak,
Use this:
wdContext.currentChild2Element().getAttribute1();
and to get any element use this:
wdContext.nodeChild2().getChild2ElementAt(x).getAttribute1();
Regards
sid
Edited by: siddharth chauhan on Jan 14, 2008 3:14 PM
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.