cancel
Showing results for 
Search instead for 
Did you mean: 

Singleton node and non singleton practical scenario

prasad
Participant
0 Kudos

Hi Friends,

Iam totally confused with singleton and non singleton node implementation please explain practical implementation on singleton and nonsingle ton node . In which scenario non single ton node is used.

Thanks in advance

Prasad

Accepted Solutions (0)

Answers (3)

Answers (3)

p330068
Active Contributor
0 Kudos

Dear Prasad,

Please read the [The Structural Concepts of Web Dynpro Components|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/a048387a-0901-0010-13ac-87f9eb649381] to know more about the singleton property in Webdynpro.

Best Regards

Arun Jaiswal

vijay_kumar49
Active Contributor
0 Kudos

Hi,

Singleton Node:

A singleton node contains only one instace of the node at runtime. And that instace contains multiple elements at runtime.

By default if we create a node under ROOT context node, it will be allways singleton true.

Non singleton node:

A non singeton node contains more then one node instance at runtime. And each instance contains multiple elements at runtime.

It is not possible to create NonSingletonNodes directly under ROOT context node. We can create under any node which is under ROOT context node.

Note: In terms of datastorage at runtime we can say if node is table then each elment of node instance is a row of that table.

When is it requried to create non singleton nodes?

For example if you have list of SalesOrders and each and every oder is having list of items. Then we can create this node structure in two ways:

Orders (singleton true)

-


> Items (singleton true)

Here in this case at any point of time the there will be only one instance of Items node exist for currently selected element of Orders node. And that instance contains multiple elements nothing but items of that order.

Orders (singleton true)

-


> Items (singleton false)

Here in this case at any point of time all the instances of Items node exist for all the elements(not only for currently selected element) of Orders node. And those instances contains multiple elements nothing but items of those corresponding orders.

I hope it helps.

Regards,

Vijay K

former_member187977
Participant
0 Kudos

right said vijay,

could you please also elaborate on how to access non-singleton nodes programatically. We accesssingleton nodes by wdContext.node<nodename>.

If a non-singleton node has say 5 instances(because of 5 parent elements), then how to access the 4th one ?

thank you !

seventyros

SAP EP

Qualiture
Active Contributor
0 Kudos

If you need a simple list of items, for instance a list of persons, you should use a singleton node (singleton nodes use less resources at runtime, and are the default node type)

However, if this person node has a child node with, say, an address node, and you want to display a table with both person details as well as address details, the address node must be made non-singleton so it can be accessed directly

In other words:

singleton nodes are related to the parent node

non-singleton nodes are related to the parent element of the parent node