cancel
Showing results for 
Search instead for 
Did you mean: 

Cardinality: automatical creation of initial elements

Former Member
0 Kudos

Hello,

as far as I know the systems automatically creates elements when the cardinality is 1..1 or 1..n. Now I would like to know when exactly the system does this creation of initial elements.

One of my context nodes has a cardinality of 1...1. In some cases I can't set the attributes because there is no element. Therefore I want to have a better understanding of when the system creates initial elements.

Best regards, Hergen

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Hergen.

The element will be created in the moment the context is initialized.

Cheers,

Sascha

Former Member
0 Kudos

Hi Sascha,

okay, but <i>when</i> does the system <i>automatically</i> initialize elements?

Former Member
0 Kudos

I would say that the context is initialized when the component is created.

I can not say when exactly, but I guess before any view, view ciontroller or view context is created.

But I can not say by heart.

What exactly is your problem?

Cheers,

Sascha

former_member215843
Active Participant
0 Kudos

Hi,

A context element is created automatically, if

- it is declared with cardinality 1..1 or 1..n and

- there is no supply function declared for this node.

If a supply function is declared, it has to make sure that the cardinality is fulfilled.

The creation of the first element is done at the same time as the supply function would be called, if there werde any.

This means: as soon as you access the element (e.g. by reading or writing any of it's attributes) the element is created.

So there should be no need for you to worry about the time, at which the element is created.

I assume that the element is not created, because you have declared a supply function.

Ciao, Regina

Former Member
0 Kudos

Hello Regina,

I indeed run into problems when a SUPPLY function is assigned.

My SUPPLY function checks whether there is an element (among other things). If not, it creates one.

But then the program dumps in

CL_WDR_VIEW_ELEMENT_ADAPTER->GET_ATTRIBUTE_EXTERNAL

because ATTRIBUTE-ELEMENT is initial (it is about the node to which the SUPPLY function is assingned).

Best regards, Hergen

former_member215843
Active Participant
0 Kudos

Hi Hergen,

there is no need to check whether there is an element in the supply function. If the supply function is called, there IS NO element in the node.

Please check the exception raised in the adapter. You find the text rather at the beginning of the dump display. Perhaps the lead selection is not set.

If this does not help, please create a message.

Ciao, Regina

Answers (0)