1. Java Rosa
  2. javarosa
Issue #4 resolved

nested repeat ignores jr:count

Yaw Anokwa
created an issue

if you specify a jr:count and a jr:noaddremove="true()" on repeat x nested inside a repeat y, the repeat x will repeat forever.

removing jr:noaddremove has no effect on this bug.

Comments (3)

  1. Yaw Anokwa reporter

    the form below breaks the core.

    java.lang.ClassCastException: java.lang.String
    	at org.javarosa.form.api.FormEntryModel.createModelIfNecessary(FormEntryModel.java:405)
    	at org.javarosa.form.api.FormEntryModel.setQuestionIndex(FormEntryModel.java:239)
    	at org.javarosa.form.api.FormEntryController.jumpToIndex(FormEntryController.java:206)
    	at org.javarosa.form.api.FormEntryController.stepEvent(FormEntryController.java:195)
    	at org.javarosa.form.api.FormEntryController.stepToNextEvent(FormEntryController.java:164)
    
    <?xml version="1.0"?>
    <h:html xmlns="http://www.w3.org/2002/xforms" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jr="http://openrosa.org/javarosa">
    	<h:head>
    		<h:title>Repeat Bug</h:title>
    		<model>
    			<instance>
    				<data id="repeat_bug">
    					<repeat_count>2</repeat_count>
    					<repeat_node>
    						<repeat_string/>
    					</repeat_node>
    				</data>
    			</instance>
    		</model>
    	</h:head>
    	<h:body>
    		<group>
    			<label>repeat node</label>
    			<repeat nodeset="/data/repeat_node" jr:count="/data/repeat_count" jr:noAddRemove="true()">
    				<input ref="/data/repeat_node/repeat_string">
    					<label>this should repeat <output value="/data/repeat_count"/> times and finish</label>
    				</input>
    			</repeat>
    		</group>
    	</h:body>
    </h:html>
    
  2. Anonymous

    just tested using a version of javarosa from the ODK trunk and it looks like this issue has not yet been fixed.

    Steven Nsubuga

  3. Log in to comment