Wiki source code of WORepetition

Last modified by Pascal Robert on 2012/01/30 22:24

Hide last authors
Pascal Robert 10.1 1 {{toc/}}
Pascal Robert 3.1 2
3 = Introduction =
4
Pascal Robert 9.1 5 A WORepetition is a container element that repeats its contents (that is, everything between the <WEBOBJECT...> and </WEBOBJECT...> tags in the template file) a given number of times. You can use a WORepetition to create dynamically generated ordered and unordered lists or banks of check boxes or radio buttons.
6
Pascal Robert 3.1 7 = Usage =
8
9 {{code}}
10
Pascal Robert 9.1 11 WORepetition {
12 list=anObjectList;
13 item=anIteratedObject;
14 [index=aNumber;]...
15 };
Pascal Robert 3.1 16
Pascal Robert 9.1 17 WORepetition {
18 count=aNumber;
19 [index=aNumber;]
20 }
21
Pascal Robert 3.1 22 {{/code}}
23
24 = Bindings =
25
Pascal Robert 10.1 26 |(((
27 list
28 )))|(((
29 Array of objects that the WORepetition will iterate through. Ideally, this should be an immutable array. If you must pass a mutable array, your code must not alter the array while the WORepetition is iterating through it.
30 )))
31 |(((
32 item
33 )))|(((
34 Current item in the list array. (This attribute's value is updated with each iteration.)
35 )))
36 |(((
37 index
38 )))|(((
39 Index of the current iteration of the WORepetition. (This attribute's value is updated with each iteration.
40 )))
41 |(((
42 count
43 )))|(((
44 Number of times this element will repeat its contents.
45 )))
Pascal Robert 9.1 46
Pascal Robert 3.1 47 = Examples =
48
49 == Java methods ==
50
51 == WOD-style ==
52
Pascal Robert 10.1 53 {{code/}}
Pascal Robert 3.1 54
55 == Inline bindings (WOOGNL) ==
56
Pascal Robert 10.1 57 {{code/}}
Pascal Robert 3.1 58
59 = Related documents =
Pascal Robert 9.1 60
Pascal Robert 10.1 61 ERXWORepetition (http:/wocommunity.org/documents/javadoc/wonder/latest/er/extensions/components/_private/ERXWORepetition.html)