on 04-06-2006 6:48 PM
Hi WebDyn Pro's,
I have a very basic question I think. I snooped thru several tutorials and sample code and I can't figure out why my code fails. It seems to me that I'm doing nothing different than the sample code.
I have one View in my project. I have a context node named "MyData". In the doInit method of the one View, I have the following code:
<b>wdContext.currentMyDataElement().setName("John"):</b>
This lines throws a nullPointer Exception.
Any ideas?
Thanks
Kevin
The context exists in the view, right? Not the controller?
Regards,
Rich Heilman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When working with Nodes, this is how I usually access the data.
In my context, there is a node called MyNode, under that there is a attribute named UserName.
public void wdDoInit()
{
//@@begin wdDoInit()
IPrivateMain.IMyNodeNode MyNode = wdContext.nodeMyNode();
IPrivateMain.IMyNodeElement MyElm;
MyElm = MyNode.createMyNodeElement();
MyElm.setUserName("Rich Heilman");
MyNode.addElement(MyElm);
//@@end
}
This works for me.
Regards,
Rich Heilman
User | Count |
---|---|
81 | |
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.