on 09-21-2006 2:44 PM
Hi All,
I am trying <b>Context Programming and Data Binding (18) tutorial</b>.
I am slight confused.. when to bind() and when to addElement()'s:
page 22>>
newCustomerNodeElement.nodeAddress().bind(newAddressNodeElement);
page 26>>
node.addElement(newOrderNodeElement);
page23 explanation >>
Note that, if you call the method bind (newCustomerNodeElement) instead of addElement(newCustomerNodeElement), only the last bound node element of the type Customer is contained in the list of node elements. That is, wdContext.nodeCustomers().bind(newCustomerNodeElement) overwrites the list of node elements of the type Customer.
Is it that .. when the cardinality is 0..1 (or) 1..1>> we have to <b>bind</b> elements and when cardinality 0..n (or) 1..n >> we have to <b>addElement();</b> ??
Also i didn't get the exact advantage of a supplyFunction.
Can any1 help me out ?? explain me .. more detailedly ???
Thank u very much in advance,
kanth.
Beginner,
In general, bind and addElement are interchangeable: you may either bind or addElement.
For example, if cardinality is 0..1 you may add sole element or bind this element. If the cardinality is 0..n then you may either bind collection of elements or add elements one by one.
Typically, bind is used when you populate node content initially, addElement is used when user adds/removes already populated node.
VS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
71 | |
26 | |
10 | |
9 | |
7 | |
6 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.