Author: erwan
Date: Thu Feb 16 12:13:49 2012 New Revision: 1244953 URL: http://svn.apache.org/viewvc?rev=1244953&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/trunk/framework/images/webapp/images/fieldlookup.js ofbiz/trunk/framework/images/webapp/images/selectall.js ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Modified: ofbiz/trunk/framework/images/webapp/images/fieldlookup.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/fieldlookup.js?rev=1244953&r1=1244952&r2=1244953&view=diff ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/fieldlookup.js (original) +++ ofbiz/trunk/framework/images/webapp/images/fieldlookup.js Thu Feb 16 12:13:49 2012 @@ -743,6 +743,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; @@ -759,6 +760,7 @@ lookupDescriptionLoaded.prototype.update } } }); + } } if(typeof String.prototype.trim !== 'function') { // Needed because IE8 does not implement trim yet Modified: ofbiz/trunk/framework/images/webapp/images/selectall.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/selectall.js?rev=1244953&r1=1244952&r2=1244953&view=diff ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/selectall.js (original) +++ ofbiz/trunk/framework/images/webapp/images/selectall.js Thu Feb 16 12:13:49 2012 @@ -433,7 +433,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, showDescription) } Modified: ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=1244953&r1=1244952&r2=1244953&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl (original) +++ ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Thu Feb 16 12:13:49 2012 @@ -674,7 +674,7 @@ Parameter: lastViewName, String, optiona </#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 + "&_LAST_VIEW_NAME_=" + lastViewName /> </#if> |
Free forum by Nabble | Edit this page |