mohan-nishit / opendatakit

Automatically exported from code.google.com/p/opendatakit
0 stars 0 forks source link

add support for jr:count in groups #259

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
add option for a group to repeat n times. 

the trick here is that the count value can be based on a previous node. it'd be 
useful to let people pick that node, or specify a custom value. 

<instance>
    <data>
        <repeat_count_a>2</repeat_count_a>
        <repeat_node_a>
            <repeat_string_a/>
        </repeat_node_a>
    </data>
</instance>

<bind nodeset="/data/repeat_count_a" type="integer"/>
<bind nodeset="/data/repeat_node_a"/>
<bind nodeset="/data/repeat_node_a/repeat_string_a" type="string"/>

<group>
    <label>repeat node a</label>
    <repeat nodeset="/data/repeat_node_a" jr:count="/data/repeat_count_a">
        <input ref="/data/repeat_node_a/repeat_string_a">
            <label>this should repeat <output value="/data/repeat_count_a"/> times and finish</label>
        </input>
    </repeat>
</group>

Original issue reported on code.google.com by yanokwa on 11 Jul 2011 at 7:13