on 11-12-2004 1:19 AM
Hi,
After a couple of days, I'm stucked.. =(
I create a value node in my controller context, then a value attribute inside my new node. I need to set the value to my new attribute but I always receive null error.
What could be wrong ? I'm practically new on this, I dont know if I need to "create" a instance, or modify a property or what.. =(
I appreciate your help, any clue is welcome..
Regards from Mexico.
Diego
I forgot to include some code:
Value Node: myNode
Value Attribute: myAttribute
I put this code in a custom method (not in doInit method):
wdContext.currentMyNodeElement().setMyAttribute("blah.");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Diego,
It seems that your node contains no elements, so call to wdContext.currentMyNodeElement() leads to NullPointerException. If it is the case, the do one of the following:
1. Set node cardinality to 1..1 (in case you need one element, not sure how 1..n works)
2. Create element(s) yourself:
final I<ControllerName>.IMyNodeElement element = wdContext.myNode().createMyNodeElement();
/* You may set attribute here */
element.setMyAttribute("blah.");
wdContext.myNode().addElement(element);
/* You may set attribute as you do it now */
wdContext.currentMyNodeElement().setMyAttribute("blah.");
VS
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
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.