FormLoadBinder loadBinder = e.getLoadBinder();
FormLoadBinder optionsBinder = e.getOptionsBinder();
if (loadBinder != null) {
if (recursive) {
// load form data
FormRowSet rowSet = formData.getLoadBinderData(e);
if (rowSet != null && !rowSet.isEmpty()) {
FormRow row = rowSet.get(0);
boolean useSubMap = !flatten && !(e instanceof Form);
if (useSubMap) {
// it's data from a different form, so put data into submap
Map<String, Object> subMap = new HashMap<String, Object>();
for (Iterator i=row.keySet().iterator(); i.hasNext();) {
String key = (String)i.next();
Object value = row.get(key);
subMap.put(key, value.toString());
}
String elementKey = e.getPropertyString(FormUtil.PROPERTY_ID);
data.put(elementKey, subMap);
result = subMap;
} else {
// it's the same as the original form, so put data into original map
for (Iterator i=row.keySet().iterator(); i.hasNext();) {
String key = (String)i.next();
Object value = row.get(key);
data.put(key, value.toString());
}
}
}
}
} else if (includeReferenceElements && e instanceof FormReferenceDataRetriever) {
// handle reference fields for elements implementing FormReferenceDataRetriever
Collection<Map<String, Object>> subResults = new ArrayList<Map<String, Object>>();
// get values
String[] valueArray = FormUtil.getElementPropertyValues(e, formData);
FormRowSet options = ((FormReferenceDataRetriever)e).loadFormRows(valueArray);
for (Map opt: options) {
Map optionRow = new HashMap(opt);
subResults.add(optionRow);
}
if (!subResults.isEmpty()) {