on 01-13-2010 10:01 AM
HI,
I want to know what is the correct way to set attributes for a non singleton node dynamically.
I have node A which contains the non singleton node B.
At runtime I want to change the attributes of node B dynamically. What is the correct way for this?
When I try wdContext.nodeB().getNodeInfo I get a NullPointerException.
For example this code works: wdContext.nodeA().getAElementAt(0).nodeB().getNodeInfo(). Here I get the node info.
But when I set attributes for the second line, are there valid for all Elements in Node B?
What is the correct way to set the attribut infos for non singleton Node B?
Best regards,
Peter
Hi Peter
The main rule here - do not touch node instances at all. Deal only with node metadata:
IWDNodeInfo nodeBInfo = wdContext.getNodeInfo().getChild("node A").getChild("node B");
nodeBInfo.getAttribute("xAttr");
nodeBInfo.addAttribute(...);
...
BR, Siarhei
Edited by: Siarhei Pisarenka on Jan 13, 2010 12:55 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 |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
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.