Author: deepak
Date: Sat Aug 27 11:29:26 2016
New Revision: 1757992
URL:
http://svn.apache.org/viewvc?rev=1757992&view=revLog:
(OFBIZ-7978) Applied patch from jira issue
================================
Client side required field validation is not working for password type field
================================
Thanks Deepak and Renuka for your contribution.
Modified:
ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java
Modified: ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java?rev=1757992&r1=1757991&r2=1757992&view=diff==============================================================================
--- ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java Sat Aug 27 11:29:26 2016
@@ -2574,6 +2574,18 @@ public final class MacroFormRenderer imp
if (!passwordField.getClientAutocompleteField()) {
autocomplete = "off";
}
+
+ //check for required field style on single forms
+ if ("single".equals(modelFormField.getModelForm().getType()) && modelFormField.getRequiredField()) {
+ String requiredStyle = modelFormField.getRequiredFieldStyle();
+ if (UtilValidate.isEmpty(requiredStyle))
+ requiredStyle = "required";
+ if (UtilValidate.isEmpty(className))
+ className = requiredStyle;
+ else
+ className = requiredStyle + " " + className;
+ }
+
String tabindex = modelFormField.getTabindex();
StringWriter sr = new StringWriter();
sr.append("<@renderPasswordField ");