cancel
Showing results for 
Search instead for 
Did you mean: 

Node Has No Valid Parent Error - Initialization

Former Member
0 Kudos

Hello please have a look at my context structure. I need to pass the values to a Web Service. These values will also first appear in disabled input fields on my web dynpro screen. How can i initialize these fields with hard coded values?

Context -

Context

- Buyer Party (Node 0..1)

-- Internal ID (Node 0..1)

-- Internal ID (Attribute String)

- Item (Node 0..1)

-- Price Component ( Node 0..1)

-- Price Speicification Code(Node 0..1)

-- Text (Attribute String)

I just want to initialize the two attributes in above context with initial values (hard Coded) to be sent to a service. How do i write my code in the wdDoInit() method?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Yogesh Bhatia,

Write the code to load the input fields with hard coded values in your view init() method.

First create an element for Buyer party node and add it to Buyer Party node as

IPrivate<view name>.IBuyerPartyNodeElement ele = wdContext.createBuyerPartyNodeElement();

wdContext.nodeBuyerPartyNode().addElement(ele);

ele.setInternalId("internal value");

Make sure you first create element to parent node and then create elements to child nodes.

Thanks & Regards,

Jaya.

Former Member
0 Kudos

Hi Jaya,

Thanks for your reply.

I am using exactly the same code as you have mentioned.

However i have not created an element to a parent node. I have directly written the code you have mentioned.

So for example, if i have a parent node to the BuyerParty node also, what changes can i bring to my code to remove the error?

That is how do i create the element for parent node (Please note thta the parent node is not the root node here. BuyerParty has a parent node also)

Thnks

Former Member
0 Kudos

Hi Yogesh Bhatia,

First create the element to the Parent node. Add the element to the corresponding node and then create the element to its child.

Suppose if you have a structure like this:

Context (level 0)

-> A Node (Level 1)

-> B Node (level 2)

-> attribute (level3)

-> C attribute (level2)

-> D Node (level 1)

-> E Node (level 2)

First create element for "A Node" and add it to wdContext.nodeANode().addElement(xxx). and then create element for B Node etc....

I am assuming that the singleton property for all your nodes in true.

Thanks & Regards,

Jaya.

Former Member
0 Kudos

Great Jaya. Thanks a ton. Let me try out.

And what will be the case if the singleton propoerty is not there for node.?

Former Member
0 Kudos

Hi Yogesh Bhatia,

If singleton property is false for a node then add the nodeelement to a parent like this.

wdContext.currentBuyerPartyNodeElement().nodeInternalIdNode().addElement(internalnodelement);

// internalnodelement is the element created for Internal Node

(or)

IPrivateTest123View.IBuyerPartyNodeElement ele = wdContext.createBuyerPartyNodeElement();

wdContext.nodeBuyerPartyNode().addElement(ele);

ele.setInternalId("internal value");

IPrivateTest123View.IInternalIdNodeElement internalNodeEle = wdContext.createInternalIdNodeElement();

ele.nodeInternalIdNode().addElement(internalNodeEle);

Thanks & Regards,

Jaya.

Former Member
0 Kudos

Thanks a ton Jaya. My problem is solved.

Answers (1)

Answers (1)

Former Member
0 Kudos

How is the "singleton" property set for these nodes?

Armin

Former Member
0 Kudos

Hi Armin,

I am using Netweaver BPM to develop a process. Therein i can set the cardinality property of the Webdynpro Context nodes using a property window.

Thnkls