cancel
Showing results for 
Search instead for 
Did you mean: 

Error in selection of cardinality

Former Member
0 Kudos

Dear Techies,

I have a few gliches in understanding Cardinality.

I have a input field and a submit button on my view. So i decided to use a node under which an attribute is binded to the input field in the view. The user may enter or may not enter the value in input field. So i have decided to use cardinality 0..1. But when i execute the application this gives me a dump.

Context binding of property value cannot be resolved. Node main1.<nodename> does not contain any elements.

This is solved if i change the cardinality to 1..1 or 1..n. Please elaborate why am i getting a dump. If we are not supposed to use cardinality of 0..1, then why does such cardinality option is given though its complelty logical to have 0 or 1 instances for the node at runtime.

Please help me in understanding the flow, here.

Regards

Imran.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Imran,

CARDINALITY tells the min. and max. numbers of elements a node may contain.

Theare are 4 properties for this.

0:1 - The node contains zero or one element.

1:1 - The node contains only one element.

0:n - The node contains n elements

1:n - The node contains one or n elements.

In webdynpro the context node act as an Internal table. To control the number of elements in the context node, the cardinality properties are used. If you want to store only one element, use 1:1, the same way with others.

actualy cardinality is nothing but it is selection of value as well as instatiation of node..

4 type of cardinality are there....

0:1----it behaves as not instatiated but may be created upto 1 element...

1:1-beahaves as it is instatiated but will create upto 1 element.

0:n--as it is not intatiated and will create upto nth element

1:n--as it is instatiated but will create upto nth element..

Actualy it is used in Value node at time of creation of any collection of data...it is one of the property of value node in contetx...before doing any thng of node..you have to set cardinality value as above....

Is it clear., pls revert for further clarification.

Regards,

Amarnath S

Former Member
0 Kudos

Hi Amarnath

Thanks for the response. I understand the use of cardinality but i use the prinipal as

Can you pls explain the problem in using cardinality 0..1 in my example. Because user may not enter a value and that gives me an option of not instantiating the node, which can be achieved by 0 as minimum and 1 as maximum because it is an input field. So logically 0..1 sounds perfect. But why is it giving a runtime error.

Regards

Imran.

ChrisPaine
Active Contributor
0 Kudos

it is important to consider that not entering anything in a field is not the same as not having a field.

That the user has not entered anything means the field now contains a blank - initial value. This is not the same as the field not existing!

In order for the system to be able to store/display that the field has an initial value - the node that holds the attribute must have at least one element.

This is different to perhaps having a table - where the user can add rows - here having a 0...n cardinality would make sense as until a row is added the data does not exist in initial state or otherwise - but with an input field displaying on the screen the system needs to know what value it should be displaying - and therefore the need for the initial element to be created.

Hope that makes sense,

Chris

Former Member
0 Kudos

Please refer to this link.

https://cw.sdn.sap.com/cw/docs/DOC-29976

Former Member
0 Kudos

Wonderful Chris..Thats really a very great explanation..

Tried mapping a table, with same cardinality and is working fine.

Was really helpful.

Thanks.

imran.

Answers (0)