cancel
Showing results for 
Search instead for 
Did you mean: 

Tree Example in WebDynpro Documentation has erros?

Former Member
0 Kudos
45

Hello,

I try to figure out how a tree works and started to build the example from the documentation.

I wonder how this example could ever been working? I have NetWeaver 6.40 SP12 plus NWDS 6.40 SP12.

Short example from documentation:


IPrivateNonRecursiveTree.ICustomerElement customer = customerNode.createCustomerElement();

       customer.setId("Customer No:" + i);
       customerNode.addElement(customer);

       IPrivateNonRecursiveTree.IOrderNode orderNode = customer.nodeOrder();

When I try to insert that part of code I get an error at:

customer.nodeOrder();

I can do:

customerNode.nodeOrder()

They try to get a node from an element, that is not supported at least in my NWDS?! Is there something new or no longer supported?

I would at least assume that all pieces of code are tested at least once. It is not the first time I found obvious errors in example source code. That is not an appropriate level of quality of documentation.

Best regards,

Frank

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Set singleton=false for the node "Customer".

Armin

Former Member
0 Kudos

Okay I had to set singleton = false for all non root value nodes and now its running

Thank you Armin.

I would suggest to add this to documentation.

Frank

Answers (3)

Answers (3)

Former Member
0 Kudos

I am asking for the link in SDN which points to the application download !!

Regards, Anilkumar

Former Member
0 Kudos

hi,

First let me tell you what i understood from your query.

You are having a node named 'customer' which has a recursive childnode 'order'.Right?

Now when you try to access the 'order' node using the element of the node 'customer' its throwing you error.

Do one thing.

Go to the properties of your recursive node 'order' .Set the property repeated node to the node customer.

Hope it'll work.

Regards,

Rahul.

Former Member
0 Kudos

Hi Frank,

Could you please post the link to the test application so that we can look into.

Thanks & Regards, Anilkumar

Former Member
0 Kudos

Hello,

it can be found in the documentation as:

Data Binding of a Tree UI Element

- Code Example for Creation of a Tree UI Element

I'm not sure whether this link may help, as it is to my local documentation:

http://localhost:<yourport>/help/topic/com.sap.devmanual.doc.user/c2/abfceffbacd24185ec7af8a3a2e76a/...

There you'll find the complete source code.

I changed all errors... Now I get an exception when I let it running:

[code]

com.sap.tc.webdynpro.progmodel.context.ContextException: Node(NonRecursiveTree.Customer.PurchaseOrder): you can access the singleton child node 'PurchaseItem' only via lead selection

at com.sap.tc.webdynpro.progmodel.context.Node.getChildNodeInternal(Node.java:1222)

at com.sap.tc.webdynpro.progmodel.context.Nodes.getChildNode(Nodes.java:81)

at com.sap.tc.webdynpro.clientimpl.html.uielib.standard.uradapter.TreeAdapter$Nodes.getNodes(TreeAdapter.java:1704)

at com.sap.tc.webdynpro.clientimpl.html.uielib.standard.uradapter.TreeAdapter$Nodes.getHasChildren(TreeAdapter.java:1446)

...

[/code]

Still trying to find out whats wrong.

Best regards,

Frank