on 10-29-2007 2:24 PM
I have a context node called Subst and want to bind a value set to one of its attributes using a modifiable simple valueset. So I called
wdContext.nodeSubst().getNodeInfo();
and got a null pointer exception because the nodeSubst is null. OK, I have cardinality 0..n, so at the moment I set the value set there is no node instance. But I want to set the value set for all node instances, not only for one. I changed the singleton property and it worked. But I don't understand why there is a difference between singleton or non-singleton and if it is important whether I have a value or model node.
Regards,
Josef
Hello Armin,
very quick answer! But the child node only exists if it (the child) is singleton? Cardinality is not important (set to 0..n)?
Is it correct that either the master node Reg must have an instance or the child node Subst must have singleton = true?
Regards,
Josef
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Josef,
Cardinality talks about the collection of the node i.e the number of elements a node can have.
Singleton is about the existence of a node instance with respect to its parent or element collection.
One instance of a singleton child node exists at runtime for one parent node instance. The contents of the child node instance change depending on the lead selection in the parent node. Node instance existence is per node basis.
Whereas, for a non-singleton node, there will be as many number of node instances as there are elements in the parent node. So parent node's cardinality, say 0..n, there will exist n child nodes. So node existence in this case is per element basis.
Regards,
Rajit
So if singleton there exists always exactly one node instance so it can never be null whereas for non-singleton node I first have to create elements or set the cardinality.
Thank you very much
Josef
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hallo Armin,
yes, you are right, the node Subst that failed was a non singleton subnode. Now as a singleton node it works. The context structure looks like:
Context (Root)
......|
......|-> Reg (singleton)
............|
............|-> Subst
I still don't get it. When I call nodeSubst(), I assumed to get the node class, not an instance. Is that correct?
Regards,
Josef
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How does the context structure look like? I guess "Subst" is a non-singleton child node of some other node?
Armin
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.