svn commit: r1366660 - /ofbiz/trunk/framework/images/webapp/images/getDependentDropdownValues.js

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

svn commit: r1366660 - /ofbiz/trunk/framework/images/webapp/images/getDependentDropdownValues.js

jleroux@apache.org
Author: jleroux
Date: Sat Jul 28 12:46:22 2012
New Revision: 1366660

URL: http://svn.apache.org/viewvc?rev=1366660&view=rev
Log:
While working on OFBIZ-4978, I changed for getDependentDropdownValues.js to load values unselected instead of loading them all selected one by one, then only the last being selected. This was actually a bug and I already wondered why the list had the last option selected by default instead of the 1st. This fixes this last aspect.

Modified:
    ofbiz/trunk/framework/images/webapp/images/getDependentDropdownValues.js

Modified: ofbiz/trunk/framework/images/webapp/images/getDependentDropdownValues.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/getDependentDropdownValues.js?rev=1366660&r1=1366659&r2=1366660&view=diff
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/getDependentDropdownValues.js (original)
+++ ofbiz/trunk/framework/images/webapp/images/getDependentDropdownValues.js Sat Jul 28 12:46:22 2012
@@ -52,7 +52,7 @@ function getDependentDropdownValues(requ
                 jQuery.each(list, function(key, value){
                     if (typeof value == 'string') {
                         values = value.split(': ');
-                        if (values[1].indexOf(selected) >= 0) {
+                        if (values[1].indexOf(selected) >= 0 && selected.length > 0) {
                             optionList += "<option selected='selected' value = " + values[1] + " >" + values[0] + "</option>";
                         } else {
                             optionList += "<option value = " + values[1] + " >" + values[0] + "</option>";