on 02-23-2006 11:02 AM
Hi,
Im trying to move the contents of a model node into a Value node. But I am getting a null pointer exception.
Here is my structure
Source node:
<Model Node>
-
<Output Node>
-
<Li Node> (li_Shipper)
-
<Model Attribute>
Destination node
<Model Node>
-
<Output Node>
-
<Li Node> (li_Allocations)
-
<Value Node> (Shipper_DD) 0..1 singleton-false
-
<Value Attribute> (Shipper)
My code is as follows:
for (int i=0; i<wdContext.nodeLi_Allocations().size();i++)
{
WDCopyService.copyElements(wdContext.nodeLi_Shipper(),wdContext.nodeLi_Allocations().getLi_AllocationsElementAt(i).nodeShipper_DD());
// Here im trying to assign a default value. Im getting the null pointer exception in this line.
wdContext.nodeLi_Allocations().getLi_AllocationsElementAt(i).nodeShipper_DD().currentShipper_DDElement().setShipper(wdContext.nodeLi_Allocations().getLi_AllocationsElementAt(i).getShipper());
}
Can anyone tell me how I can rectify this?
Reena,
Set the cardinality of the <Value Node> (Shipper_DD) to 1:1.
Bala
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Reena,
You need to first bind the model object vairables in the wdDoInit() method of the controller.
And after you have done that you can set the values like this:
IPrivate<View>.I<Node>Element ele= wdcontext.createnodeCElement();
ele.setItem1(<value>);
wdcontext.nodeC.addElement(ele);
Please try to create an element under the node. Please check the code for syntax. I hope this should solve your problem.
Thanks & Regards
--Vishal Sood
<b>PS: Please provide points for helpful answers</b>
Hi Reena,
have u created the instance of value node u r using........if no create it and then try.......
Regards,
Yash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.