use of org.apache.ofbiz.widget.model.ModelForm in project ofbiz-framework by apache.
the class WidgetWorker method makeLinkHiddenFormName.
public static String makeLinkHiddenFormName(Map<String, Object> context, ModelFormField modelFormField) {
ModelForm modelForm = modelFormField.getModelForm();
Integer itemIndex = (Integer) context.get("itemIndex");
String iterateId = "";
String formUniqueId = "";
String formName = (String) context.get("formName");
if (UtilValidate.isEmpty(formName)) {
formName = modelForm.getName();
}
if (UtilValidate.isNotEmpty(context.get("iterateId"))) {
iterateId = (String) context.get("iterateId");
}
if (UtilValidate.isNotEmpty(context.get("formUniqueId"))) {
formUniqueId = (String) context.get("formUniqueId");
}
if (itemIndex != null) {
return formName + modelForm.getItemIndexSeparator() + itemIndex.intValue() + iterateId + formUniqueId + modelForm.getItemIndexSeparator() + modelFormField.getName();
}
return formName + modelForm.getItemIndexSeparator() + modelFormField.getName();
}
Aggregations