Search in sources :

Example 11 with ModelForm

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();
}
Also used : ModelForm(org.apache.ofbiz.widget.model.ModelForm)

Aggregations

ModelForm (org.apache.ofbiz.widget.model.ModelForm)11 StringWriter (java.io.StringWriter)7 ModelFormField (org.apache.ofbiz.widget.model.ModelFormField)5 IOException (java.io.IOException)3 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)3 GeneralException (org.apache.ofbiz.base.util.GeneralException)3 SAXException (org.xml.sax.SAXException)3 TemplateException (freemarker.template.TemplateException)2 File (java.io.File)2 Timestamp (java.sql.Timestamp)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 WeakHashMap (java.util.WeakHashMap)2 HttpServletRequest (javax.servlet.http.HttpServletRequest)2 HttpServletResponse (javax.servlet.http.HttpServletResponse)2 GenericEntityException (org.apache.ofbiz.entity.GenericEntityException)2 GenericServiceException (org.apache.ofbiz.service.GenericServiceException)2 ModelScreen (org.apache.ofbiz.widget.model.ModelScreen)2 ModelTheme (org.apache.ofbiz.widget.model.ModelTheme)2 Calendar (com.ibm.icu.util.Calendar)1