svn commit: r1244954 - in /ofbiz/branches/release11.04/framework: images/webapp/images/fieldlookup.js images/webapp/images/selectall.js widget/templates/htmlFormMacroLibrary.ftl

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1244954 - in /ofbiz/branches/release11.04/framework: images/webapp/images/fieldlookup.js images/webapp/images/selectall.js widget/templates/htmlFormMacroLibrary.ftl

erwan
Author: erwan
Date: Thu Feb 16 12:14:11 2012
New Revision: 1244954

URL: http://svn.apache.org/viewvc?rev=1244954&view=rev
Log:
OFBIZ-4667 At the time of page load unnecessary ajax request executed to get the lookup description. - A patch from Amardeep Singh Jhajj

Modified:
    ofbiz/branches/release11.04/framework/images/webapp/images/fieldlookup.js
    ofbiz/branches/release11.04/framework/images/webapp/images/selectall.js
    ofbiz/branches/release11.04/framework/widget/templates/htmlFormMacroLibrary.ftl

Modified: ofbiz/branches/release11.04/framework/images/webapp/images/fieldlookup.js
URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/framework/images/webapp/images/fieldlookup.js?rev=1244954&r1=1244953&r2=1244954&view=diff
==============================================================================
--- ofbiz/branches/release11.04/framework/images/webapp/images/fieldlookup.js (original)
+++ ofbiz/branches/release11.04/framework/images/webapp/images/fieldlookup.js Thu Feb 16 12:14:11 2012
@@ -755,6 +755,7 @@ lookupDescriptionLoaded.prototype.update
   //actual server call
   var fieldName = this.params.substring(this.params.indexOf("searchValueFieldName"));
   fieldName = fieldName.substring(fieldName.indexOf("=") + 1);
+  if (jQuery("input[name=" + fieldName + "]").val()) {
   var fieldSerialized = jQuery("input[name=" + fieldName + "]", jQuery("form[name=" + this.formName + "]")).serialize();
   this.allParams = this.params + '&' + fieldSerialized + '&' + 'searchType=EQUALS';
   _fieldId = this.fieldId;
@@ -771,6 +772,7 @@ lookupDescriptionLoaded.prototype.update
       }
     }
   });
+  }
 }
     
 if(typeof String.prototype.trim !== 'function') { // Needed because IE8 does not implement trim yet

Modified: ofbiz/branches/release11.04/framework/images/webapp/images/selectall.js
URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/framework/images/webapp/images/selectall.js?rev=1244954&r1=1244953&r2=1244954&view=diff
==============================================================================
--- ofbiz/branches/release11.04/framework/images/webapp/images/selectall.js (original)
+++ ofbiz/branches/release11.04/framework/images/webapp/images/selectall.js Thu Feb 16 12:14:11 2012
@@ -436,7 +436,6 @@ function ajaxAutoCompleter(areaCsvString
             select: function(event, ui){
                 //jQuery("#" + areaArray[0]).html(ui.item);
                 jQuery("#" + areaArray[0]).val(ui.item.value); // setting a text field  
-                jQuery("#" + areaArray[0]).trigger("lookup:changed"); // notify the field has changed
                 if (showDescription) {
                     setLookDescription(areaArray[0], ui.item.label, areaArray[2], formName)
                 }

Modified: ofbiz/branches/release11.04/framework/widget/templates/htmlFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=1244954&r1=1244953&r2=1244954&view=diff
==============================================================================
--- ofbiz/branches/release11.04/framework/widget/templates/htmlFormMacroLibrary.ftl (original)
+++ ofbiz/branches/release11.04/framework/widget/templates/htmlFormMacroLibrary.ftl Thu Feb 16 12:14:11 2012
@@ -613,7 +613,7 @@ ${item.description}</span>
 </#if>
 <#if readonly?has_content && readonly><a id="${id}_clear" style="background:none;margin-left:5px;margin-right:15px;" class="clearField" href="javascript:void();" onclick="javascript:document.${formName}.${name}.value='';<#if descriptionFieldName?has_content>document.${formName}.${descriptionFieldName}.value='';</#if>">${clearText}</a></#if>
 </span>
-<#if ajaxEnabled?has_content && ajaxEnabled>
+<#if ajaxEnabled?has_content && ajaxEnabled && (presentation?has_content && presentation == "window")>
       <#if ajaxUrl?index_of("_LAST_VIEW_NAME_") < 0>
         <#local ajaxUrl = ajaxUrl + "&amp;_LAST_VIEW_NAME_=" + lastViewName />
       </#if>