Author: jleroux
Date: Wed Sep 2 13:04:56 2009
New Revision: 810497
URL:
http://svn.apache.org/viewvc?rev=810497&view=revLog:
A patch from Abdullah Shaikh "macro to display error messages individually besides each input field" (
https://issues.apache.org/jira/browse/OFBIZ-2890) - OFBIZ-2890
Modified:
ofbiz/trunk/framework/common/webcommon/includes/commonMacros.ftl
Modified: ofbiz/trunk/framework/common/webcommon/includes/commonMacros.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/commonMacros.ftl?rev=810497&r1=810496&r2=810497&view=diff==============================================================================
--- ofbiz/trunk/framework/common/webcommon/includes/commonMacros.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/includes/commonMacros.ftl Wed Sep 2 13:04:56 2009
@@ -74,3 +74,25 @@
<span class="tooltip">${uiLabelMap.CommonRequired}</span>
</#if>
</#macro>
+
+<#macro fieldErrors fieldName>
+ <#if errorMessageList?has_content>
+ <#assign fieldMessages = Static["org.ofbiz.base.util.MessageString"].getMessagesForField(fieldName, true, errorMessageList)>
+ <ul>
+ <#list fieldMessages as errorMsg>
+ <li class="errorMessage">${errorMsg}</li>
+ </#list>
+ </ul>
+ </#if>
+</#macro>
+
+<#macro fieldErrorsMulti fieldName1 fieldName2 fieldName3 fieldName4>
+ <#if errorMessageList?has_content>
+ <#assign fieldMessages = Static["org.ofbiz.base.util.MessageString"].getMessagesForField(fieldName1, fieldName2, fieldName3, fieldName4, true, errorMessageList)>
+ <ul>
+ <#list fieldMessages as errorMsg>
+ <li class="errorMessage">${errorMsg}</li>
+ </#list>
+ </ul>
+ </#if>
+</#macro>