Skip to Content
avatar image
Former Member

Cardinality of a value node

Dear friends,

When I create a value node in the context controller why should I change its cardinality to 1..1 and not to keep it as the default one 0..n? And what will happen if I leave it unchanged?

I really want to understand that from the runtime data point of view.

regards,

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Jun 07, 2008 at 08:56 AM

    Hi Hisham,

    Cardinality:

    Any node or attribute that has the context root node as its immediate parent, is known as an independent node or attribute.

    Any node or attribute that has some other node as its immediate parent, is known as a dependent node or attribute.

    All context nodes are collections.

    A node collection is composed of elements, where an element is an aggregation of the node’s immediate children (attributes and/or other nodes).

    The cardinality property controls the number of elements a node collection may hold at runtime.

    Every context node has a property called Cardinality. This property is composed of two values that taken together, describe the maximum and minimum number of elements the node collection may hold

    at runtime.

    Therefore, there are four possible cardinality values (specified as <Min>..<Max>)

    0:1: At most one element can be selected

    1:1: Exactly one is selected

    0:N: Any number of elements can be selected

    1:N: At least one ...

    The first two values define a node with single-selection. The second two values define a node with multi-selection.

    Like if you have input field , in that case if you are binding it with the value node then you need cardinality as 1:1/1:n.

    The reason is that it will create an element always for you so that you can give some input in this element.

    If you set the cardinality to 0:1/0:n then it will disable the input field and user will not be able to enter the data.

    Thanks n Regards,

    Jhansi Miryala

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 07, 2008 at 09:19 AM

    1:1 value nodes come handy for grouping attributes that semantically belong together. Another common use-case is to add additional attributes to nodes with structure binding where this is not possible directly. In that case these additional attributes are added to a 1:1 value (sub-)node.

    When cardinality is 1:* the framework automatically creates a node element.

    Armin

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 07, 2008 at 10:10 AM

    Thanks to Armin Reichert & Jhansi Miryala for their response and valuable explanations. I really got it clear.

    Add comment
    10|10000 characters needed characters exceeded