Wiki source code of WORepetition
Last modified by Pascal Robert on 2012/01/30 22:24
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | {{toc/}} | ||
2 | |||
3 | = Introduction = | ||
4 | |||
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 | |||
7 | = Usage = | ||
8 | |||
9 | {{code}} | ||
10 | |||
11 | WORepetition { | ||
12 | list=anObjectList; | ||
13 | item=anIteratedObject; | ||
14 | [index=aNumber;]... | ||
15 | }; | ||
16 | |||
17 | WORepetition { | ||
18 | count=aNumber; | ||
19 | [index=aNumber;] | ||
20 | } | ||
21 | |||
22 | {{/code}} | ||
23 | |||
24 | = Bindings = | ||
25 | |||
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 | ))) | ||
46 | |||
47 | = Examples = | ||
48 | |||
49 | == Java methods == | ||
50 | |||
51 | == WOD-style == | ||
52 | |||
53 | {{code/}} | ||
54 | |||
55 | == Inline bindings (WOOGNL) == | ||
56 | |||
57 | {{code/}} | ||
58 | |||
59 | = Related documents = | ||
60 | |||
61 | ERXWORepetition (http:/wocommunity.org/documents/javadoc/wonder/latest/er/extensions/components/_private/ERXWORepetition.html) |