This is an automated email from the ASF dual-hosted git repository.

pawan pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 3b7e637  Improved: Expansion of form widget field disabled atrribute 
with xsd improvement (#141)
3b7e637 is described below

commit 3b7e63744c9148b0c9c8130a5a818d33dcebda3c
Author: Pawan Verma <verma-pa...@users.noreply.github.com>
AuthorDate: Tue May 19 17:37:24 2020 +0530

    Improved: Expansion of form widget field disabled atrribute with xsd 
improvement (#141)
    
    (OFBIZ-10432)
    
    1. Added disabled attribute support in ModelFormField with xs:boolean type
    2. Removed specific field level disabled attribute support for CheckField 
and TextField
    3. Modified existing usage of disabled attribute as per new implementation.
    
    Thanks: Rishi for the report and Taher, Gil and Jacques for the feedback
---
 applications/accounting/widget/InvoiceForms.xml    |  2 +-
 .../product/widget/catalog/ReviewForms.xml         |  2 +-
 framework/widget/dtd/widget-form.xsd               | 10 +--------
 .../apache/ofbiz/widget/model/ModelFormField.java  | 25 ++++++----------------
 .../ofbiz/widget/model/ModelFormFieldBuilder.java  |  9 ++++++++
 .../ofbiz/widget/model/XmlWidgetFieldVisitor.java  |  2 --
 .../widget/renderer/macro/MacroFormRenderer.java   | 24 +++++++++++++++------
 .../template/macro/CsvFormMacroLibrary.ftl         |  8 +++----
 .../template/macro/FoFormMacroLibrary.ftl          |  8 +++----
 .../template/macro/HtmlFormMacroLibrary.ftl        | 14 ++++++------
 .../template/macro/TextFormMacroLibrary.ftl        |  8 +++----
 .../template/macro/XlsFormMacroLibrary.ftl         |  8 +++----
 .../template/macro/XmlFormMacroLibrary.ftl         |  8 +++----
 13 files changed, 64 insertions(+), 64 deletions(-)

diff --git a/applications/accounting/widget/InvoiceForms.xml 
b/applications/accounting/widget/InvoiceForms.xml
index 40e2550..b141f80 100644
--- a/applications/accounting/widget/InvoiceForms.xml
+++ b/applications/accounting/widget/InvoiceForms.xml
@@ -513,7 +513,7 @@ under the License.
         <field name="invoiceId"><hidden/></field>
         <field name="paymentId"><lookup 
target-form-name="LookupPayment"/></field>
         <field name="billingAccountId"><hidden/></field>
-        <field name="amountToApply"><text size="10" disabled="true"/></field>
+        <field name="amountToApply" disabled="true"><text size="10"/></field>
         <field name="updateButton" title="${uiLabelMap.CommonUpdate}" 
widget-style="buttontext"><submit button-type="text-link"/></field>
         <field name="removeButton" title=" " widget-style="buttontext" 
use-when="paymentApplicationId!=null">
             <hyperlink description="${uiLabelMap.CommonRemove}" 
target="removeInvoiceApplication">
diff --git a/applications/product/widget/catalog/ReviewForms.xml 
b/applications/product/widget/catalog/ReviewForms.xml
index 663a98c..c7f6a21 100644
--- a/applications/product/widget/catalog/ReviewForms.xml
+++ b/applications/product/widget/catalog/ReviewForms.xml
@@ -64,7 +64,7 @@ under the License.
         <field name="statusId" 
title="${uiLabelMap.CommonStatus}"><display-entity 
entity-name="StatusItem"/></field>
         <field name="userLoginId" title="${uiLabelMap.ProductReviewBy}" 
><display/></field>
         <field name="productRating" ignore-when="${statusId == 
'PRR_DELETED'}"><text/></field>
-        <field name="productRating" ignore-when="${statusId != 
'PRR_DELETED'}"><text disabled="true"/></field>
+        <field name="productRating" ignore-when="${statusId != 'PRR_DELETED'}" 
disabled="true"><text/></field>
         <field name="productReview" ignore-when="${statusId == 
'PRR_DELETED'}"><textarea/></field>
         <field name="productReview" ignore-when="${statusId != 
'PRR_DELETED'}"><textarea read-only="true"/></field>
         <field name="submitButton" title="${uiLabelMap.CommonUpdate}" 
use-when="${statusId != 'PRR_DELETED'}"><submit button-type="button"/></field>
diff --git a/framework/widget/dtd/widget-form.xsd 
b/framework/widget/dtd/widget-form.xsd
index d452ef9..68a9829 100644
--- a/framework/widget/dtd/widget-form.xsd
+++ b/framework/widget/dtd/widget-form.xsd
@@ -840,6 +840,7 @@ under the License.
                     </xs:documentation>
                 </xs:annotation>
             </xs:attribute>
+            <xs:attribute name="disabled" type="xs:boolean" default="false"/>
         </xs:complexType>
     </xs:element>
 
@@ -852,14 +853,6 @@ under the License.
                 <xs:element ref="option" />
             </xs:choice>
             <xs:attribute name="all-checked" type="xs:boolean"/>
-            <xs:attribute name="disabled" default="false">
-                <xs:simpleType>
-                    <xs:restriction base="xs:token">
-                        <xs:enumeration value="true" />
-                        <xs:enumeration value="false" />
-                    </xs:restriction>
-                </xs:simpleType>
-            </xs:attribute>
         </xs:complexType>
     </xs:element>
     <xs:element name="container" substitutionGroup="AllFields">
@@ -1435,7 +1428,6 @@ under the License.
             <xs:attribute type="xs:positiveInteger" name="size" default="25" />
             <xs:attribute type="xs:positiveInteger" name="maxlength" />
             <xs:attribute type="xs:string" name="default-value" />
-            <xs:attribute name="disabled" type="xs:boolean" default="false"/>
             <xs:attribute name="client-autocomplete-field"
                           type="xs:boolean" default="true">
                 <xs:annotation>
diff --git 
a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java
 
b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java
index 52546a6..10e5383 100644
--- 
a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java
+++ 
b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java
@@ -163,6 +163,7 @@ public class ModelFormField {
     private final String parentFormName;
     private final String tabindex;
     private final String conditionGroup;
+    private final boolean disabled;
 
     private ModelFormField(ModelFormFieldBuilder builder) {
         this.action = builder.getAction();
@@ -217,6 +218,7 @@ public class ModelFormField {
         this.parentFormName = builder.getParentFormName();
         this.tabindex = builder.getTabindex();
         this.conditionGroup = builder.getConditionGroup();
+        this.disabled = builder.getDisabled();
     }
 
     public FlexibleStringExpander getAction() {
@@ -487,6 +489,10 @@ public class ModelFormField {
         return conditionGroup;
     }
 
+    public boolean getDisabled() {
+        return disabled;
+    }
+
     public Map<String, ? extends Object> getMap(Map<String, ? extends Object> 
context) {
         if (UtilValidate.isEmpty(this.mapAcsr)) {
             return this.modelForm.getDefaultMap(context);
@@ -1034,30 +1040,25 @@ public class ModelFormField {
     public static class CheckField extends FieldInfoWithOptions {
         public final static String ROW_SUBMIT_FIELD_NAME = "_rowSubmit";
         private final FlexibleStringExpander allChecked;
-        private final boolean disabled;
 
         private CheckField(CheckField original, ModelFormField modelFormField) 
{
             super(original, modelFormField);
             this.allChecked = original.allChecked;
-            this.disabled = original.disabled;
         }
 
         public CheckField(Element element, ModelFormField modelFormField) {
             super(element, modelFormField);
             allChecked = 
FlexibleStringExpander.getInstance(element.getAttribute("all-checked"));
-            this.disabled = "true".equals(element.getAttribute("disabled"));
         }
 
         public CheckField(int fieldSource, ModelFormField modelFormField) {
             super(fieldSource, FieldInfo.CHECK, modelFormField);
             this.allChecked = FlexibleStringExpander.getInstance("");
-            this.disabled = false;
         }
 
         public CheckField(ModelFormField modelFormField) {
             super(FieldInfo.SOURCE_EXPLICIT, FieldInfo.CHECK, modelFormField);
             this.allChecked = FlexibleStringExpander.getInstance("");
-            this.disabled = false;
         }
 
         @Override
@@ -1082,10 +1083,6 @@ public class ModelFormField {
             return null;
         }
 
-        public boolean getDisabled() {
-            return this.disabled;
-        }
-
         @Override
         public void renderFieldString(Appendable writer, Map<String, Object> 
context, FormStringRenderer formStringRenderer)
                 throws IOException {
@@ -4146,7 +4143,6 @@ public class ModelFormField {
     public static class TextField extends FieldInfo {
         private final boolean clientAutocompleteField;
         private final FlexibleStringExpander defaultValue;
-        private final boolean disabled;
         private final String mask;
         private final Integer maxlength;
         private final FlexibleStringExpander placeholder;
@@ -4158,7 +4154,6 @@ public class ModelFormField {
             super(element, modelFormField);
             this.clientAutocompleteField = 
!"false".equals(element.getAttribute("client-autocomplete-field"));
             this.defaultValue = 
FlexibleStringExpander.getInstance(element.getAttribute("default-value"));
-            this.disabled = "true".equals(element.getAttribute("disabled"));
             this.mask = element.getAttribute("mask");
             Integer maxlength = null;
             String maxlengthStr = element.getAttribute("maxlength");
@@ -4196,7 +4191,6 @@ public class ModelFormField {
             super(fieldSource, fieldType == -1 ? FieldInfo.TEXT : fieldType, 
modelFormField);
             this.clientAutocompleteField = true;
             this.defaultValue = FlexibleStringExpander.getInstance("");
-            this.disabled = false;
             this.mask = "";
             this.maxlength = maxlength;
             this.placeholder = FlexibleStringExpander.getInstance("");
@@ -4209,7 +4203,6 @@ public class ModelFormField {
             super(fieldSource, FieldInfo.TEXT, modelFormField);
             this.clientAutocompleteField = true;
             this.defaultValue = FlexibleStringExpander.getInstance("");
-            this.disabled = false;
             this.mask = "";
             this.maxlength = maxlength;
             this.placeholder = FlexibleStringExpander.getInstance("");
@@ -4222,7 +4215,6 @@ public class ModelFormField {
             super(fieldSource, fieldType, modelFormField);
             this.clientAutocompleteField = true;
             this.defaultValue = FlexibleStringExpander.getInstance("");
-            this.disabled = false;
             this.mask = "";
             this.maxlength = null;
             this.placeholder = FlexibleStringExpander.getInstance("");
@@ -4247,7 +4239,6 @@ public class ModelFormField {
             this.placeholder = original.placeholder;
             this.size = original.size;
             this.maxlength = original.maxlength;
-            this.disabled = original.disabled;
             this.readonly = original.readonly;
             if (original.subHyperlink != null) {
                 this.subHyperlink = new SubHyperlink(original.subHyperlink, 
modelFormField);
@@ -4281,10 +4272,6 @@ public class ModelFormField {
             return "";
         }
 
-        public boolean getDisabled() {
-            return this.disabled;
-        }
-
         public String getMask() {
             return this.mask;
         }
diff --git 
a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormFieldBuilder.java
 
b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormFieldBuilder.java
index 22d59d1..6e27a47 100644
--- 
a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormFieldBuilder.java
+++ 
b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormFieldBuilder.java
@@ -114,6 +114,7 @@ public class ModelFormFieldBuilder {
     private String parentFormName = "";
     private String tabindex = "";
     private String conditionGroup = "";
+    private boolean disabled= false;
 
     protected static final List<String> numericFieldTypes = 
Collections.unmodifiableList(UtilMisc.toList(
             "floating-point", "numeric", "fixed-point",
@@ -203,6 +204,7 @@ public class ModelFormFieldBuilder {
         this.parentFormName = fieldElement.getAttribute("form-name");
         this.tabindex = fieldElement.getAttribute("tabindex");
         this.conditionGroup = fieldElement.getAttribute("condition-group");
+        this.disabled = "true".equals(fieldElement.getAttribute("disabled"));
         Element childElement = null;
         List<? extends Element> subElements = 
UtilXml.childElementList(fieldElement);
         for (Element subElement : subElements) {
@@ -319,6 +321,7 @@ public class ModelFormFieldBuilder {
         this.parentFormName = modelFormField.getParentFormName();
         this.tabindex = modelFormField.getTabindex();
         this.conditionGroup = modelFormField.getConditionGroup();
+        this.disabled = modelFormField.getDisabled();
     }
 
     public ModelFormFieldBuilder(ModelFormFieldBuilder builder) {
@@ -361,6 +364,7 @@ public class ModelFormFieldBuilder {
         this.parentFormName = builder.getParentFormName();
         this.tabindex = builder.getTabindex();
         this.conditionGroup = builder.getConditionGroup();
+        this.disabled = builder.getDisabled();
     }
 
     public ModelFormFieldBuilder addOnChangeUpdateArea(UpdateArea 
onChangeUpdateArea) {
@@ -541,6 +545,10 @@ public class ModelFormFieldBuilder {
         return conditionGroup;
     }
 
+    public boolean getDisabled() {
+        return disabled;
+    }
+
     private boolean induceFieldInfo(ModelForm modelForm, String 
defaultFieldType, ModelReader entityModelReader, DispatchContext 
dispatchContext) {
         if (induceFieldInfoFromEntityField(defaultFieldType, 
entityModelReader)) {
             return true;
@@ -825,6 +833,7 @@ public class ModelFormFieldBuilder {
         this.position = builder.getPosition();
         this.requiredField = builder.getRequiredField();
         this.separateColumn = builder.getSeparateColumn();
+        this.disabled = builder.getDisabled();
     }
 
     public ModelFormFieldBuilder setAction(String action) {
diff --git 
a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/XmlWidgetFieldVisitor.java
 
b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/XmlWidgetFieldVisitor.java
index 7a24eca..d0c5a7a 100644
--- 
a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/XmlWidgetFieldVisitor.java
+++ 
b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/XmlWidgetFieldVisitor.java
@@ -68,7 +68,6 @@ public class XmlWidgetFieldVisitor extends 
XmlAbstractWidgetVisitor implements M
         visitModelField(checkField.getModelFormField());
         writer.append("<check");
         visitAttribute("all-checked", checkField.getAllChecked());
-        visitAttribute("disabled", checkField.getDisabled());
         visitFieldInfoWithOptions(checkField);
         writer.append("</check></field>");
     }
@@ -341,7 +340,6 @@ public class XmlWidgetFieldVisitor extends 
XmlAbstractWidgetVisitor implements M
     private void visitTextFieldAttrs(TextField field) throws Exception {
         visitAttribute("client-autocomplete-field", 
field.getClientAutocompleteField());
         visitAttribute("default-value", field.getDefaultValue());
-        visitAttribute("disabled", field.getDisabled());
         visitAttribute("mask", field.getMask());
         visitAttribute("maxlength", field.getMaxlength());
         visitAttribute("placeholder", field.getPlaceholder());
diff --git 
a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java
 
b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java
index cbf06a8..cfa6152 100644
--- 
a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java
+++ 
b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java
@@ -389,7 +389,7 @@ public final class MacroFormRenderer implements 
FormStringRenderer {
             mask = textField.getMask();
         }
         String ajaxUrl = createAjaxParamsFromUpdateAreas(updateAreas, "", 
context);
-        boolean disabled = textField.getDisabled();
+        boolean disabled = modelFormField.getDisabled();
         boolean readonly = textField.getReadonly();
         String tabindex = modelFormField.getTabindex();
         StringWriter sr = new StringWriter();
@@ -495,6 +495,7 @@ public final class MacroFormRenderer implements 
FormStringRenderer {
         }
         String tabindex = modelFormField.getTabindex();
         String value = modelFormField.getEntry(context, 
textareaField.getDefaultValue(context));
+        boolean disabled = modelFormField.getDisabled();
         StringWriter sr = new StringWriter();
         sr.append("<@renderTextareaField ");
         sr.append("name=\"");
@@ -523,7 +524,9 @@ public final class MacroFormRenderer implements 
FormStringRenderer {
         sr.append(buttons);
         sr.append("\" tabindex=\"");
         sr.append(tabindex);
-        sr.append("\" />");
+        sr.append("\" disabled=");
+        sr.append(Boolean.toString(disabled));
+        sr.append(" />");
         executeMacro(writer, sr.toString());
         this.addAsterisks(writer, context, modelFormField);
         this.appendTooltip(writer, context, modelFormField);
@@ -534,6 +537,7 @@ public final class MacroFormRenderer implements 
FormStringRenderer {
         ModelFormField modelFormField = dateTimeField.getModelFormField();
         String paramName = modelFormField.getParameterName(context);
         String defaultDateTimeString = 
dateTimeField.getDefaultDateTimeString(context);
+        boolean disabled = modelFormField.getDisabled();
         String className = "";
         String alert = "false";
         String name = "";
@@ -770,7 +774,9 @@ public final class MacroFormRenderer implements 
FormStringRenderer {
         sr.append(formattedMask);
         sr.append("\" tabindex=\"");
         sr.append(tabindex);
-        sr.append("\" />");
+        sr.append("\" disabled=");
+        sr.append(Boolean.toString(disabled));
+        sr.append(" />");
         executeMacro(writer, sr.toString());
         this.addAsterisks(writer, context, modelFormField);
         this.appendTooltip(writer, context, modelFormField);
@@ -782,6 +788,7 @@ public final class MacroFormRenderer implements 
FormStringRenderer {
         ModelForm modelForm = modelFormField.getModelForm();
         String currentValue = modelFormField.getEntry(context);
         String conditionGroup = modelFormField.getConditionGroup();
+        boolean disabled = modelFormField.getDisabled();
         List<ModelFormField.OptionValue> allOptionValues = 
dropDownField.getAllOptionValues(context, WidgetWorker.getDelegator(context));
         ModelFormField.AutoComplete autoComplete = 
dropDownField.getAutoComplete();
         String event = modelFormField.getEvent();
@@ -1012,7 +1019,9 @@ public final class MacroFormRenderer implements 
FormStringRenderer {
         sr.append(conditionGroup);
         sr.append("\" tabindex=\"");
         sr.append(tabindex);
-        sr.append("\" />");
+        sr.append("\" disabled=");
+        sr.append(Boolean.toString(disabled));
+        sr.append(" />");
         executeMacro(writer, sr.toString());
         ModelFormField.SubHyperlink subHyperlink = 
dropDownField.getSubHyperlink();
         if (subHyperlink != null && subHyperlink.shouldUse(context)) {
@@ -1027,7 +1036,7 @@ public final class MacroFormRenderer implements 
FormStringRenderer {
         String currentValue = modelFormField.getEntry(context);
         String conditionGroup = modelFormField.getConditionGroup();
         Boolean allChecked = checkField.isAllChecked(context);
-        boolean disabled = checkField.getDisabled();
+        boolean disabled = modelFormField.getDisabled();
         String id = modelFormField.getCurrentContainerId(context);
         String className = "";
         String alert = "false";
@@ -1095,6 +1104,7 @@ public final class MacroFormRenderer implements 
FormStringRenderer {
         List<ModelFormField.OptionValue> allOptionValues = 
radioField.getAllOptionValues(context, WidgetWorker.getDelegator(context));
         String currentValue = modelFormField.getEntry(context);
         String conditionGroup = modelFormField.getConditionGroup();
+        boolean disabled = modelFormField.getDisabled();
         String className = "";
         String alert = "false";
         String name = modelFormField.getParameterName(context);
@@ -1146,7 +1156,9 @@ public final class MacroFormRenderer implements 
FormStringRenderer {
         sr.append(conditionGroup);
         sr.append("\" tabindex=\"");
         sr.append(tabindex);
-        sr.append("\" />");
+        sr.append("\" disabled=");
+        sr.append(Boolean.toString(disabled));
+        sr.append(" />");
         executeMacro(writer, sr.toString());
         this.appendTooltip(writer, context, modelFormField);
     }
diff --git a/themes/common-theme/template/macro/CsvFormMacroLibrary.ftl 
b/themes/common-theme/template/macro/CsvFormMacroLibrary.ftl
index b371b19..ec64dd1 100644
--- a/themes/common-theme/template/macro/CsvFormMacroLibrary.ftl
+++ b/themes/common-theme/template/macro/CsvFormMacroLibrary.ftl
@@ -26,11 +26,11 @@ under the License.
 
 <#macro renderTextField name className alert value textSize maxlength id event 
action disabled clientAutocomplete ajaxUrl ajaxEnabled mask tabindex readonly 
placeholder="" delegatorName="default"><@renderField value /></#macro>
 
-<#macro renderTextareaField name className alert cols rows maxlength id 
readonly value visualEditorEnable buttons tabindex language=""><@renderField 
value /></#macro>
+<#macro renderTextareaField name className alert cols rows maxlength id 
readonly value visualEditorEnable buttons tabindex language="" 
disabled=""><@renderField value /></#macro>
 
-<#macro renderDateTimeField name className alert title value size maxlength id 
dateType shortDateInput timeDropdownParamName defaultDateTimeString 
localizedIconTitle timeDropdown timeHourName classString hour1 hour2 
timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected 
compositeType formName mask="" event="" action="" step="" timeValues="" 
tabindex="" ><@renderField value /></#macro>
+<#macro renderDateTimeField name className alert title value size maxlength id 
dateType shortDateInput timeDropdownParamName defaultDateTimeString 
localizedIconTitle timeDropdown timeHourName classString hour1 hour2 
timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected 
compositeType formName mask="" event="" action="" step="" timeValues="" 
tabindex="" disabled=""><@renderField value /></#macro>
 
-<#macro renderDropDownField name className alert id multiple formName 
otherFieldName event action size firstInList currentValue explicitDescription 
allowEmpty options fieldName otherFieldName otherValue otherFieldSize 
dDFCurrent ajaxEnabled noCurrentSelectedKey ajaxOptions frequency minChars 
choices autoSelect partialSearch partialChars ignoreCase fullSearch 
conditionGroup tabindex>
+<#macro renderDropDownField name className alert id multiple formName 
otherFieldName event action size firstInList currentValue explicitDescription 
allowEmpty options fieldName otherFieldName otherValue otherFieldSize 
dDFCurrent ajaxEnabled noCurrentSelectedKey ajaxOptions frequency minChars 
choices autoSelect partialSearch partialChars ignoreCase fullSearch 
conditionGroup tabindex disabled>
 <#if currentValue?has_content && firstInList?has_content>
 <@renderField explicitDescription />
 <#else>
@@ -42,7 +42,7 @@ under the License.
 
 <#macro renderTooltip tooltip tooltipStyle></#macro>
 <#macro renderCheckField items className alert id allChecked currentValue name 
event action conditionGroup tabindex disabled></#macro>
-<#macro renderRadioField items className alert currentValue 
noCurrentSelectedKey name event action conditionGroup tabindex></#macro>
+<#macro renderRadioField items className alert currentValue 
noCurrentSelectedKey name event action conditionGroup tabindex 
disabled></#macro>
 
 <#macro renderSubmitField buttonType className alert formName title name event 
action imgSrc confirmation containerId ajaxUrl tabindex></#macro>
 <#macro renderResetField className alert name title></#macro>
diff --git a/themes/common-theme/template/macro/FoFormMacroLibrary.ftl 
b/themes/common-theme/template/macro/FoFormMacroLibrary.ftl
index 29189db..21ef4a4 100644
--- a/themes/common-theme/template/macro/FoFormMacroLibrary.ftl
+++ b/themes/common-theme/template/macro/FoFormMacroLibrary.ftl
@@ -53,11 +53,11 @@ under the License.
 
 <#macro renderTextField name className alert value textSize maxlength id event 
action disabled clientAutocomplete ajaxUrl ajaxEnabled mask tabindex readonly 
placeholder="" delegatorName="default"><@makeBlock className value /></#macro>
 
-<#macro renderTextareaField name className alert cols rows maxlength id 
readonly value visualEditorEnable language buttons tabindex 
language=""><@makeBlock className value /></#macro>
+<#macro renderTextareaField name className alert cols rows maxlength id 
readonly value visualEditorEnable language buttons tabindex language="" 
disabled=""><@makeBlock className value /></#macro>
 
-<#macro renderDateTimeField name className alert title value size maxlength 
step timeValues id event action dateType shortDateInput timeDropdownParamName 
defaultDateTimeString localizedIconTitle timeDropdown timeHourName classString 
hour1 hour2 timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected 
compositeType formName mask="" event="" action="" step="" timeValues="" 
tabindex=""><@makeBlock className value /></#macro>
+<#macro renderDateTimeField name className alert title value size maxlength 
step timeValues id event action dateType shortDateInput timeDropdownParamName 
defaultDateTimeString localizedIconTitle timeDropdown timeHourName classString 
hour1 hour2 timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected 
compositeType formName mask="" event="" action="" step="" timeValues="" 
tabindex="" disabled=""><@makeBlock className value /></#macro>
 
-<#macro renderDropDownField name className alert id multiple formName 
otherFieldName event action size explicitDescription allowEmpty options 
fieldName otherFieldName otherValue otherFieldSize dDFCurrent ajaxEnabled 
noCurrentSelectedKey ajaxOptions frequency minChars choices autoSelect 
partialSearch partialChars ignoreCase fullSearch conditionGroup tabindex 
firstInList="" currentValue="">
+<#macro renderDropDownField name className alert id multiple formName 
otherFieldName event action size explicitDescription allowEmpty options 
fieldName otherFieldName otherValue otherFieldSize dDFCurrent ajaxEnabled 
noCurrentSelectedKey ajaxOptions frequency minChars choices autoSelect 
partialSearch partialChars ignoreCase fullSearch conditionGroup tabindex 
firstInList="" currentValue="" disabled="">
 <#if currentValue?has_content && firstInList?has_content>
 <@makeBlock "" explicitDescription />
 <#else>
@@ -68,7 +68,7 @@ under the License.
 </#macro>
 
 <#macro renderCheckField items className alert id allChecked currentValue name 
event action conditionGroup tabindex disabled><@makeBlock "" "" /></#macro>
-<#macro renderRadioField items className alert currentValue 
noCurrentSelectedKey name event action conditionGroup tabindex><@makeBlock "" 
"" /></#macro>
+<#macro renderRadioField items className alert currentValue 
noCurrentSelectedKey name event action conditionGroup tabindex 
disabled><@makeBlock "" "" /></#macro>
 
 <#macro renderSubmitField buttonType className alert formName title name event 
action imgSrc confirmation containerId ajaxUrl tabindex><@makeBlock "" "" 
/></#macro>
 <#macro renderResetField className alert name title><@makeBlock "" "" 
/></#macro>
diff --git a/themes/common-theme/template/macro/HtmlFormMacroLibrary.ftl 
b/themes/common-theme/template/macro/HtmlFormMacroLibrary.ftl
index 9e6c62c..fa549ea 100644
--- a/themes/common-theme/template/macro/HtmlFormMacroLibrary.ftl
+++ b/themes/common-theme/template/macro/HtmlFormMacroLibrary.ftl
@@ -70,7 +70,7 @@ under the License.
   /><#t/>
 </#macro>
 
-<#macro renderTextareaField name className alert cols="" rows="" maxlength="" 
id="" readonly="" value="" visualEditorEnable="" buttons="" tabindex="" 
language="">
+<#macro renderTextareaField name className alert cols="" rows="" maxlength="" 
id="" readonly="" value="" visualEditorEnable="" buttons="" tabindex="" 
language="" disabled="">
   <#if visualEditorEnable?has_content>
     <#local className = className + " visual-editor">
   </#if>
@@ -84,12 +84,13 @@ under the License.
     <#if tabindex?has_content> tabindex="${tabindex}"</#if><#rt/>
     <#if visualEditorEnable?has_content> 
data-toolbar="${buttons?default("maxi")}"</#if><#rt/>
     <#if language?has_content> data-language="${language!"en"}"</#if><#rt/>
+    <#if disabled?has_content> disabled="${disabled}"</#if><#rt/>
     ><#t/>
     <#if value?has_content>${value}</#if><#t/>
   </textarea><#lt/>
 </#macro>
 
-<#macro renderDateTimeField name className alert dateType 
timeDropdownParamName defaultDateTimeString localizedIconTitle timeHourName 
timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected 
compositeType timeDropdown="" classString="" hour1="" hour2="" 
shortDateInput="" title="" value="" size="" maxlength="" id="" formName="" 
mask="" event="" action="" step="" timeValues="" tabindex="" >
+<#macro renderDateTimeField name className alert dateType 
timeDropdownParamName defaultDateTimeString localizedIconTitle timeHourName 
timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected 
compositeType timeDropdown="" classString="" hour1="" hour2="" 
shortDateInput="" title="" value="" size="" maxlength="" id="" formName="" 
mask="" event="" action="" step="" timeValues="" tabindex="" disabled="">
   <span class="view-calendar">
     <#if dateType!="time" >
       <input type="text" <#if tabindex?has_content> 
tabindex="${tabindex}"</#if> name="${name}_i18n" <@renderClass className alert 
/><#rt/>
@@ -97,6 +98,7 @@ under the License.
         <#if value?has_content> value="${value}"</#if>
         <#if size?has_content> size="${size}"</#if><#rt/>
         <#if maxlength?has_content>  maxlength="${maxlength}"</#if>
+        <#if disabled?has_content> disabled="${disabled}"</#if><#rt/>
         <#if id?has_content> id="${id}_i18n"</#if>/><#rt/>
         <#local className = className + " date-time-picker"/>
     </#if>
@@ -140,12 +142,12 @@ under the License.
   </span>
 </#macro>
 
-<#macro renderDropDownField name className alert id formName action 
explicitDescription options fieldName otherFieldName otherValue otherFieldSize 
ajaxEnabled ajaxOptions frequency minChars choices autoSelect partialSearch 
partialChars ignoreCase fullSearch conditionGroup="" tabindex="" multiple="" 
event="" size="" firstInList="" currentValue="" allowEmpty="" dDFCurrent="" 
noCurrentSelectedKey="">
+<#macro renderDropDownField name className alert id formName action 
explicitDescription options fieldName otherFieldName otherValue otherFieldSize 
ajaxEnabled ajaxOptions frequency minChars choices autoSelect partialSearch 
partialChars ignoreCase fullSearch conditionGroup="" tabindex="" multiple="" 
event="" size="" firstInList="" currentValue="" allowEmpty="" dDFCurrent="" 
noCurrentSelectedKey="" disabled="">
   <#if conditionGroup?has_content>
     <input type="hidden" name="${name}_grp" value="${conditionGroup}"/>
   </#if>
   <span class="ui-widget">
-    <select name="${name?default("")}<#rt/>" <@renderClass className alert 
/><#if id?has_content> id="${id}"</#if><#if multiple?has_content> 
multiple="multiple"</#if><#if ajaxEnabled> 
class="autoCompleteDropDown"</#if><#if event?has_content> 
${event}="${action}"</#if><#if size?has_content> size="${size}"</#if><#if 
tabindex?has_content> tabindex="${tabindex}"</#if><#rt/>
+    <select name="${name?default("")}<#rt/>" <@renderClass className alert 
/><#if id?has_content> id="${id}"</#if><#if multiple?has_content> 
multiple="multiple"</#if><#if ajaxEnabled> 
class="autoCompleteDropDown"</#if><#if event?has_content> 
${event}="${action}"</#if><#if size?has_content> size="${size}"</#if><#if 
tabindex?has_content> tabindex="${tabindex}"</#if><#if disabled?has_content && 
disabled> disabled="${disabled}"</#if><#rt/>
     <#if otherFieldName?has_content>
     data-other-field-name="${otherFieldName}"
     data-other-field-value='${otherValue?js_string}'
@@ -189,14 +191,14 @@ under the License.
   </#list>
 </#macro>
 
-<#macro renderRadioField items className alert name action conditionGroup="" 
currentValue="" noCurrentSelectedKey="" event="" tabindex="">
+<#macro renderRadioField items className alert name action conditionGroup="" 
currentValue="" noCurrentSelectedKey="" event="" tabindex="" disabled="">
   <#if conditionGroup?has_content>
     <input type="hidden" name="${name}_grp" value="${conditionGroup}"/>
   </#if>
   <#list items as item>
     <span <@renderClass className alert />><#rt/>
       <input type="radio"<#if currentValue?has_content><#if 
currentValue==item.key> checked="checked"</#if><#if tabindex?has_content> 
tabindex="${tabindex}"</#if><#rt/>
-        <#elseif noCurrentSelectedKey?has_content && noCurrentSelectedKey == 
item.key> checked="checked"</#if>
+        <#elseif noCurrentSelectedKey?has_content && noCurrentSelectedKey == 
item.key> checked="checked"</#if><#if disabled?has_content> 
disabled="${disabled}"</#if>
         name="${name?default("")?html}" 
value="${item.key?default("")?html}"<#if event?has_content> 
${event}="${action}"</#if>/><#rt/>
       ${item.description}
     </span>
diff --git a/themes/common-theme/template/macro/TextFormMacroLibrary.ftl 
b/themes/common-theme/template/macro/TextFormMacroLibrary.ftl
index 0e97938..c7303e8 100644
--- a/themes/common-theme/template/macro/TextFormMacroLibrary.ftl
+++ b/themes/common-theme/template/macro/TextFormMacroLibrary.ftl
@@ -26,11 +26,11 @@ under the License.
 
 <#macro renderTextField name className alert value textSize maxlength id event 
action disabled clientAutocomplete ajaxUrl ajaxEnabled mask tabindex readonly 
placeholder="" delegatorName="default"><@renderField value /></#macro>
 
-<#macro renderTextareaField name className alert cols rows maxlength id 
readonly value visualEditorEnable buttons tabindex language=""><@renderField 
value /></#macro>
+<#macro renderTextareaField name className alert cols rows maxlength id 
readonly value visualEditorEnable buttons tabindex language="" 
disabled=""><@renderField value /></#macro>
 
-<#macro renderDateTimeField name className alert title value size maxlength id 
dateType shortDateInput timeDropdownParamName defaultDateTimeString 
localizedIconTitle timeDropdown timeHourName classString hour1 hour2 
timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected 
compositeType formName mask="" event="" action="" step="" timeValues="" 
tabindex="" ><@renderField value /></#macro>
+<#macro renderDateTimeField name className alert title value size maxlength id 
dateType shortDateInput timeDropdownParamName defaultDateTimeString 
localizedIconTitle timeDropdown timeHourName classString hour1 hour2 
timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected 
compositeType formName mask="" event="" action="" step="" timeValues="" 
tabindex="" disabled=""><@renderField value /></#macro>
 
-<#macro renderDropDownField name className alert id multiple formName 
otherFieldName event action size firstInList currentValue explicitDescription 
allowEmpty options fieldName otherFieldName otherValue otherFieldSize 
dDFCurrent ajaxEnabled noCurrentSelectedKey ajaxOptions frequency minChars 
choices autoSelect partialSearch partialChars ignoreCase fullSearch 
conditionGroup tabindex>
+<#macro renderDropDownField name className alert id multiple formName 
otherFieldName event action size firstInList currentValue explicitDescription 
allowEmpty options fieldName otherFieldName otherValue otherFieldSize 
dDFCurrent ajaxEnabled noCurrentSelectedKey ajaxOptions frequency minChars 
choices autoSelect partialSearch partialChars ignoreCase fullSearch 
conditionGroup tabindex disabled>
 <#if currentValue?has_content && firstInList?has_content>
 <@renderField explicitDescription />
 <#else>
@@ -42,7 +42,7 @@ under the License.
 
 <#macro renderTooltip tooltip tooltipStyle></#macro>
 <#macro renderCheckField items className alert id allChecked currentValue name 
event action conditionGroup tabindex disabled></#macro>
-<#macro renderRadioField items className alert currentValue 
noCurrentSelectedKey name event action conditionGroup tabindex></#macro>
+<#macro renderRadioField items className alert currentValue 
noCurrentSelectedKey name event action conditionGroup tabindex 
disabled></#macro>
 
 <#macro renderSubmitField buttonType className alert formName title name event 
action imgSrc confirmation containerId ajaxUrl tabindex></#macro>
 <#macro renderResetField className alert name title></#macro>
diff --git a/themes/common-theme/template/macro/XlsFormMacroLibrary.ftl 
b/themes/common-theme/template/macro/XlsFormMacroLibrary.ftl
index 0472f2d..6d50f94 100644
--- a/themes/common-theme/template/macro/XlsFormMacroLibrary.ftl
+++ b/themes/common-theme/template/macro/XlsFormMacroLibrary.ftl
@@ -32,19 +32,19 @@ under the License.
 
 <#macro renderTextField name className alert value textSize maxlength id event 
action disabled clientAutocomplete ajaxUrl ajaxEnabled mask tabindex readonly 
placeholder="" delegatorName="default"><@renderItemField value "txf" 
className/></#macro>
 
-<#macro renderTextareaField name className alert cols rows maxlength id 
readonly value visualEditorEnable buttons tabindex language=""></#macro>
+<#macro renderTextareaField name className alert cols rows maxlength id 
readonly value visualEditorEnable buttons tabindex language="" 
disabled=""></#macro>
 
-<#macro renderDateTimeField name className alert title value size maxlength id 
dateType shortDateInput timeDropdownParamName defaultDateTimeString 
localizedIconTitle timeDropdown timeHourName classString hour1 hour2 
timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected 
compositeType formName mask="" event="" action="" step="" timeValues="" 
tabindex="" >
+<#macro renderDateTimeField name className alert title value size maxlength id 
dateType shortDateInput timeDropdownParamName defaultDateTimeString 
localizedIconTitle timeDropdown timeHourName classString hour1 hour2 
timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected 
compositeType formName mask="" event="" action="" step="" timeValues="" 
tabindex="" disabled="">
 <#if dateType=="time" ><@renderItemField value "tf" className/>
 <#elseif dateType=="date"><@renderItemField value "dt" className/>
 <#else><@renderItemField value "dtf" className/></#if>
 </#macro>
 
-<#macro renderDropDownField name className alert id multiple formName 
otherFieldName event action size firstInList currentValue explicitDescription 
allowEmpty options fieldName otherFieldName otherValue otherFieldSize 
dDFCurrent ajaxEnabled noCurrentSelectedKey ajaxOptions frequency minChars 
choices autoSelect partialSearch partialChars ignoreCase fullSearch 
conditionGroup tabindex><@renderItemField explicitDescription "txf" 
className/></#macro>
+<#macro renderDropDownField name className alert id multiple formName 
otherFieldName event action size firstInList currentValue explicitDescription 
allowEmpty options fieldName otherFieldName otherValue otherFieldSize 
dDFCurrent ajaxEnabled noCurrentSelectedKey ajaxOptions frequency minChars 
choices autoSelect partialSearch partialChars ignoreCase fullSearch 
conditionGroup tabindex disabled><@renderItemField explicitDescription "txf" 
className/></#macro>
 
 <#macro renderCheckField items className alert id allChecked currentValue name 
event action conditionGroup tabindex disabled><@renderItemField currentValue 
"txf" className/></#macro>
 
-<#macro renderRadioField items className alert currentValue 
noCurrentSelectedKey name event action conditionGroup 
tabindex><@renderItemField currentValue "txf" className/></#macro>
+<#macro renderRadioField items className alert currentValue 
noCurrentSelectedKey name event action conditionGroup tabindex 
disabled><@renderItemField currentValue "txf" className/></#macro>
 
 <#macro renderSubmitField buttonType className alert formName title name event 
action imgSrc confirmation containerId ajaxUrl tabindex></#macro>
 
diff --git a/themes/common-theme/template/macro/XmlFormMacroLibrary.ftl 
b/themes/common-theme/template/macro/XmlFormMacroLibrary.ftl
index acc2f28..6780b8c 100644
--- a/themes/common-theme/template/macro/XmlFormMacroLibrary.ftl
+++ b/themes/common-theme/template/macro/XmlFormMacroLibrary.ftl
@@ -42,15 +42,15 @@ under the License.
 
 <#macro renderTextField name className alert value textSize maxlength id event 
action disabled clientAutocomplete ajaxUrl ajaxEnabled mask tabindex readonly 
placeholder="" delegatorName="default"><@renderField value/></#macro>
 
-<#macro renderTextareaField name className alert cols rows maxlength id 
readonly value visualEditorEnable buttons tabindex language=""><@renderField 
value/></#macro>
+<#macro renderTextareaField name className alert cols rows maxlength id 
readonly value visualEditorEnable buttons tabindex language="" 
disabled=""><@renderField value/></#macro>
 
-<#macro renderDateTimeField name className alert title value size maxlength id 
dateType shortDateInput timeDropdownParamName defaultDateTimeString 
localizedIconTitle timeDropdown timeHourName classString hour1 hour2 
timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected 
compositeType formName mask="" event="" action="" step="" timeValues="" 
tabindex="" ><@renderField value/></#macro>
+<#macro renderDateTimeField name className alert title value size maxlength id 
dateType shortDateInput timeDropdownParamName defaultDateTimeString 
localizedIconTitle timeDropdown timeHourName classString hour1 hour2 
timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected 
compositeType formName mask="" event="" action="" step="" timeValues="" 
tabindex="" disabled=""><@renderField value/></#macro>
 
-<#macro renderDropDownField name className alert id multiple formName 
otherFieldName event action size firstInList currentValue explicitDescription 
allowEmpty options fieldName otherFieldName otherValue otherFieldSize 
dDFCurrent ajaxEnabled noCurrentSelectedKey ajaxOptions frequency minChars 
choices autoSelect partialSearch partialChars ignoreCase fullSearch 
conditionGroup tabindex>
+<#macro renderDropDownField name className alert id multiple formName 
otherFieldName event action size firstInList currentValue explicitDescription 
allowEmpty options fieldName otherFieldName otherValue otherFieldSize 
dDFCurrent ajaxEnabled noCurrentSelectedKey ajaxOptions frequency minChars 
choices autoSelect partialSearch partialChars ignoreCase fullSearch 
conditionGroup tabindex disabled>
 </#macro>
 
 <#macro renderCheckField items className alert id allChecked currentValue name 
event action conditionGroup tabindex disabled></#macro>
-<#macro renderRadioField items className alert currentValue 
noCurrentSelectedKey name event action conditionGroup tabindex></#macro>
+<#macro renderRadioField items className alert currentValue 
noCurrentSelectedKey name event action conditionGroup tabindex 
disabled></#macro>
 
 <#macro renderSubmitField buttonType className alert formName title name event 
action imgSrc confirmation containerId ajaxUrl tabindex></#macro>
 <#macro renderResetField className alert name title></#macro>

Reply via email to