diff --git a/src/main/java/org/javarosa/core/model/FormDef.java b/src/main/java/org/javarosa/core/model/FormDef.java index 0b93a05c1..30b86e31b 100755 --- a/src/main/java/org/javarosa/core/model/FormDef.java +++ b/src/main/java/org/javarosa/core/model/FormDef.java @@ -55,7 +55,6 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.List; -import java.util.Map; import java.util.NoSuchElementException; import java.util.Vector; @@ -1855,4 +1854,13 @@ public String dispatchSendCallout(String url, Multimap paramMap) return sendCalloutHandler.performHttpCalloutForResponse(url, paramMap); } } + + // Checks if the form element at given form Index belongs to a non counted repeat + public boolean isNonCountedRepeat(FormIndex formIndex) { + IFormElement currentElement = getChild(formIndex); + if (currentElement instanceof GroupDef && ((GroupDef)currentElement).isRepeat()) { + return ((GroupDef)currentElement).getCountReference() == null; + } + return false; + } } diff --git a/src/main/java/org/javarosa/form/api/FormEntryModel.java b/src/main/java/org/javarosa/form/api/FormEntryModel.java index 757d4b7c3..4fc153eb8 100644 --- a/src/main/java/org/javarosa/form/api/FormEntryModel.java +++ b/src/main/java/org/javarosa/form/api/FormEntryModel.java @@ -625,4 +625,8 @@ public String getDebugInfo(FormIndex index, String category) { return TraceSerialization.serializeEvaluationTrace(indexDebug.get(category), TraceSerialization.TraceInfoType.FULL_PROFILE, false); } + + public boolean isNonCountedRepeat() { + return getForm().isNonCountedRepeat(getFormIndex()); + } }