Wiki source code of WORepetition
Version 9.1 by Pascal Robert on 2012/01/30 22:24
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | {{toc}}{{/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 | | list | 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. | ||
27 | | item | Current item in the list array. (This attribute's value is updated with each iteration.) | ||
28 | | index | Index of the current iteration of the WORepetition. (This attribute's value is updated with each iteration. | ||
29 | | count | Number of times this element will repeat its contents. | ||
30 | |||
31 | = Examples = | ||
32 | |||
33 | == Java methods == | ||
34 | |||
35 | == WOD-style == | ||
36 | |||
37 | {{code}} | ||
38 | |||
39 | |||
40 | {{/code}} | ||
41 | |||
42 | == Inline bindings (WOOGNL) == | ||
43 | |||
44 | {{code}} | ||
45 | |||
46 | |||
47 | {{/code}} | ||
48 | |||
49 | = Related documents = | ||
50 | |||
51 | [[ERXWORepetition>>http:wocommunity.orgdocumentsjavadocwonderlatesterextensionscomponents_privateERXWORepetition.html]] |