//if id field not exist, automatically add an id hidden field
Element idElement = FormUtil.findElement(FormUtil.PROPERTY_ID, subForm, formData);
if (idElement == null) {
Collection<Element> subFormElements = subForm.getChildren();
idElement = new HiddenField();
idElement.setProperty(FormUtil.PROPERTY_ID, FormUtil.PROPERTY_ID);
idElement.setParent(subForm);
subFormElements.add(idElement);
}