Skip to Content
0
Former Member
May 19, 2005 at 07:59 PM

Null pointer exception

15 Views

Trying to create nodes dynamically. Node heirarchy is as follows

RootNode

---C100 (parent node)

-


Division (child node)

-


DivisionSet (child-child node)

All nodes are created at runtime. Except C100, all node elements are dependent non-singletons

When I execute I get a 'Null point exception' at line marked with ####, when trying to create IWDNodeElement nodeElem

Code is as follows..................................

IWDNodeInfo salesOrgs = wdContext.nodeSalesOrgs().getNodeInfo();

IWDNodeInfo salesOrg = salesOrgs.addChild("C100",null,true,true,true,false,false,true,null,null,null);

IWDNodeInfo salesOrgElement = salesOrg.addChild("Division",null,false,true,true,false,false,true,null,null,null);

salesOrg.addAttribute("defaultValue","ddic:com.sap.dictionary.string");

salesOrg.addAttribute("labelValue","ddic:com.sap.dictionary.string");

salesOrgElement.addChild("Division"+"Set",null,false,true,true,false,false,true,null,null,null);

IWDNode node = wdContext.wdGetAPI().getRootNode().getChildNode("Division",2);

IWDNodeElement nodeElem = node.createElement(); //##### - Problem here

nodeElem.setAttributeValue("defaultValue","");

nodeElem.setAttributeValue("labelValue","");

node.addElement(nodeElem);

//@@end

}

Do let me know how to recrify.

Thanks !

Sri