svn commit: r1746133 - /ofbiz/branches/release15.12/framework/common/webcommon/includes/setDependentDropdownValuesJs.ftl

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

svn commit: r1746133 - /ofbiz/branches/release15.12/framework/common/webcommon/includes/setDependentDropdownValuesJs.ftl

pranayp
Author: pranayp
Date: Mon May 30 13:40:46 2016
New Revision: 1746133

URL: http://svn.apache.org/viewvc?rev=1746133&view=rev
Log:
Manually applied fix from trunk revision 1746130.
---------------------------------------------------------------------

[OFBIZ-7130] Applied patch from the ticket to fix error on console when navigating to update party email address view.

This error occurs due to the code used for dependent drop down for country and state. At party email address update page, no dependent drop down used, so js code triggering the request with empty countryGeoId and generating console error. Added check in code that if drop down field is not present on page then no need to observe it for the change.

Thanks Amardeep Singh Jhajj for reporting the issue and providing patch.
---------------------------------------------------------------------

Modified:
    ofbiz/branches/release15.12/framework/common/webcommon/includes/setDependentDropdownValuesJs.ftl

Modified: ofbiz/branches/release15.12/framework/common/webcommon/includes/setDependentDropdownValuesJs.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/release15.12/framework/common/webcommon/includes/setDependentDropdownValuesJs.ftl?rev=1746133&r1=1746132&r2=1746133&view=diff
==============================================================================
--- ofbiz/branches/release15.12/framework/common/webcommon/includes/setDependentDropdownValuesJs.ftl (original)
+++ ofbiz/branches/release15.12/framework/common/webcommon/includes/setDependentDropdownValuesJs.ftl Mon May 30 13:40:46 2016
@@ -19,7 +19,7 @@ under the License.
 <#assign requestName><@ofbizUrl>${requestName}</@ofbizUrl></#assign>
 <script type="text/javascript">
 jQuery(document).ready(function() {
-    if (jQuery('#${dependentForm}').length) {
+    if (jQuery('#${dependentForm}').length && jQuery('#${dependentForm}_${mainId}').length) {
       jQuery('#${dependentForm}_${mainId}').change(function(e, data) {
           getDependentDropdownValues('${requestName}', '${paramKey}', '${dependentForm}_${mainId}', '${dependentForm}_${dependentId}', '${responseName}', '${dependentKeyName}', '${descName}');
       });