You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2012/08/05 13:48:44 UTC

svn commit: r1369561 - /ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl

Author: jleroux
Date: Sun Aug  5 11:48:44 2012
New Revision: 1369561

URL: http://svn.apache.org/viewvc?rev=1369561&view=rev
Log:
renderLookupField macro comments improvement
Simple formatting (tabs to 2 spaces)
Fixes a bug which prevented to show an i18n "clear" text when layered lookups were used in read only mode from FTL templates
Fixes a bug which prevented to clear the description (at right of button) when layered lookups were used in read only mode 

Modified:
    ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl

Modified: ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=1369561&r1=1369560&r2=1369561&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Sun Aug  5 11:48:44 2012
@@ -592,8 +592,8 @@ Parameter: width, String or Integer, opt
 Parameter: height, String or Integer, optional - The height of the lookup field.
 Parameter: position, String, optional - The position style of the lookup field.
 Parameter: fadeBackground, ?
-Parameter: clearText, String, optional - If the readonly parameter is true, clearText contains the text to be displayed in the field.
-Parameter: showDescription, String, optional - ? (contains "true" or "false").
+Parameter: clearText, String, optional - If the readonly parameter is true, clearText contains the text to be displayed in the field, default is CommonClear label.
+Parameter: showDescription, String, optional - If the showDescription parameter is true, a special span with css class "tooltip" will be created at right of the lookup button and a description will fill in (see setLookDescription in selectall.js). For now not when the lookup is read only.
 Parameter: initiallyCollapsed, Not used.
 Parameter: lastViewName, String, optional - If the ajaxEnabled parameter is true, the contents of lastViewName will be appended to the Ajax URL.
 -->
@@ -653,45 +653,56 @@ Parameter: lastViewName, String, optiona
           </#if>
       </#if>
     </#if>
-	<script type="text/javascript">
+  <script type="text/javascript">
         jQuery(document).ready(function(){
-        	var options = {
-        		requestUrl : "${fieldFormName}",
-				inputFieldId : "${id}",
-				dialogTarget : document.${formName?html}.${name?html},
-				dialogOptionalTarget : <#if descriptionFieldName?has_content>document.${formName?html}.${descriptionFieldName}<#else>null</#if>,
-				formName : "${formName?html}",
-				width : "${width}",
-				height : "${height}",
-				position : "${position}",
-				modal : "${fadeBackground}",
-				ajaxUrl : <#if ajaxEnabled?has_content && ajaxEnabled>"${ajaxUrl}"<#else>""</#if>,
-				showDescription : <#if ajaxEnabled?has_content && ajaxEnabled>"${showDescription}"<#else>false</#if>,
-				presentation : "${presentation!}",
-				defaultMinLength : "${defaultMinLength!2}",
-				defaultDelay : "${defaultDelay!300}",
-				args : <#rt/>
-					    <#if targetParameterIter?has_content>
-						    <#assign isFirst = true>
-						    <#lt/>[<#rt/>
-						    <#list targetParameterIter as item>
-						      <#if isFirst>
-						          <#lt/>document.${formName}.${item}<#rt/>
-						          <#assign isFirst = false>
-						      <#else>
-						          <#lt/> ,document.${formName}.${item}<#rt/>
-						      </#if>
-						    </#list>
-						    <#lt/>]<#rt/>
-					    <#else>[]
-					    </#if>
-            		   <#lt/>
-        	};
-		new Lookup(options).init();
+          var options = {
+            requestUrl : "${fieldFormName}",
+            inputFieldId : "${id}",
+            dialogTarget : document.${formName?html}.${name?html},
+            dialogOptionalTarget : <#if descriptionFieldName?has_content>document.${formName?html}.${descriptionFieldName}<#else>null</#if>,
+            formName : "${formName?html}",
+            width : "${width}",
+            height : "${height}",
+            position : "${position}",
+            modal : "${fadeBackground}",
+            ajaxUrl : <#if ajaxEnabled?has_content && ajaxEnabled>"${ajaxUrl}"<#else>""</#if>,
+            showDescription : <#if ajaxEnabled?has_content && ajaxEnabled>"${showDescription}"<#else>false</#if>,
+            presentation : "${presentation!}",
+            defaultMinLength : "${defaultMinLength!2}",
+            defaultDelay : "${defaultDelay!300}",
+            args :
+                 <#rt/>
+                 <#if targetParameterIter?has_content>
+                   <#assign isFirst = true>
+                   <#lt/>[<#rt/>
+                   <#list targetParameterIter as item>
+                     <#if isFirst>
+                      <#lt/>document.${formName}.${item}<#rt/>
+                      <#assign isFirst = false>
+                    <#else>
+                      <#lt/> ,document.${formName}.${item}<#rt/>
+                    </#if>
+                   </#list>
+                   <#lt/>]<#rt/>
+                 <#else>[]
+                 </#if>
+                 <#lt/>
+          };
+          new Lookup(options).init();
         });
     </script>
 </#if>
-<#if readonly?has_content && readonly><a id="${id}_clear" style="background:none;margin-left:5px;margin-right:15px;" class="clearField" href="javascript:void(0);" onclick="javascript:document.${formName}.${name}.value='';<#if descriptionFieldName?has_content>document.${formName}.${descriptionFieldName}.value='';</#if>">${clearText}</a></#if>
+<#if readonly?has_content && readonly>
+  <a id="${id}_clear" 
+      style="background:none;margin-left:5px;margin-right:15px;" 
+      class="clearField" 
+      href="javascript:void(0);" 
+      onclick="javascript:document.${formName}.${name}.value='';
+              jQuery('#' + jQuery('#${id}_clear').next().attr('id').replace('_button','') + '_${id}_lookupDescription').html('');
+              <#if descriptionFieldName?has_content>document.${formName}.${descriptionFieldName}.value='';</#if>">
+      <#if clearText?has_content>${clearText}<#else>${uiLabelMap.CommonClear}</#if>
+  </a>
+</#if>
 </span>
 <#if ajaxEnabled?has_content && ajaxEnabled && (presentation?has_content && presentation == "window")>
       <#if ajaxUrl?index_of("_LAST_VIEW_NAME_") < 0>