cancel
Showing results for 
Search instead for 
Did you mean: 

Sngleton Property Basics .

Former Member
0 Kudos

Hi Everyone,

I want some one to help me correct my understanding of singleton property of a node. I have a node with sales order no as the only field and a child node as sales item details with 2 or more fields.

Parent Node named as Header_data ( cardinality 0..n, selection o..n, and singleton = YES)

Child node named as Item_data ( cardinality 0..n, selection o..n, and singleton = NO )

Now I have implemented a supply method named get_supply. In this method I have written codes to get the child node data.

The header node is filled during initialisation.

So far I understand what cardinality is, I do understand what selection is, I too understand what supply function is doing. Supply function gets me data in the child node every time my selection of parent node or header data changes.

But when I make the child node singleton property to NO or YES the output appears no different to me. Ideally as per my understanding if singleton property is set to NO of the child node, then when we select multiple Order no. for eg 1001 and 1002, then the item table should be filled with all the item nos in 1001 and 1002 orders respectively. And if singleton set to YES, then only the items of order selected/highlighted first during multiple selection will appear in child node. But if my understanding is correct then my program is not working it shows same result for both singleton property to NO or YES.

And if my understand is wrong, I would appreciate if some one can clarify my doubt using same/ similar example.

Rgds,

Anu.

.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Anupama

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.

Former Member
0 Kudos

Can you tell me where will the other items be stored when child node is non-singleton node?

i.e., suppose the child node is non-singleton, this means irrespective of lead selection of parent, all the child node data is selected. So how do i get rest of the data? Is it stored some where in memory which is not accessible for the user?

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> Can you tell me where will the other items be stored when child node is non-singleton node?

>

> i.e., suppose the child node is non-singleton, this means irrespective of lead selection of parent, all the child node data is selected. So how do i get rest of the data? Is it stored some where in memory which is not accessible for the user?

The data is still stored in the context. It is very much like when you use create nested internal tables. You can think of it as the entire child node is stored within the parent element. You can access any of the child node data regardless of the leadSelection - you just have to do so via the parent context element. You can access an element by index regardless of if it has leadSelection or not.

Former Member
0 Kudos

Thanks.

Former Member
0 Kudos

Thanks.

Answers (0)