svn commit: r1036417 - /ofbiz/branches/jquery/framework/common/webcommon/includes/ajaxAutocompleteOptions.ftl

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

svn commit: r1036417 - /ofbiz/branches/jquery/framework/common/webcommon/includes/ajaxAutocompleteOptions.ftl

jleroux@apache.org
Author: jleroux
Date: Thu Nov 18 11:33:08 2010
New Revision: 1036417

URL: http://svn.apache.org/viewvc?rev=1036417&view=rev
Log:
autocomp should be assigned only if autocompleteOptions exists.
A bit of formatting while at it too


Modified:
    ofbiz/branches/jquery/framework/common/webcommon/includes/ajaxAutocompleteOptions.ftl

Modified: ofbiz/branches/jquery/framework/common/webcommon/includes/ajaxAutocompleteOptions.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/framework/common/webcommon/includes/ajaxAutocompleteOptions.ftl?rev=1036417&r1=1036416&r2=1036417&view=diff
==============================================================================
--- ofbiz/branches/jquery/framework/common/webcommon/includes/ajaxAutocompleteOptions.ftl (original)
+++ ofbiz/branches/jquery/framework/common/webcommon/includes/ajaxAutocompleteOptions.ftl Thu Nov 18 11:33:08 2010
@@ -33,23 +33,22 @@ under the License.
     </#if>
 <#else>
 <script type="text/javascript">
-var autocomp = [
     <#if autocompleteOptions?exists>
+  var autocomp = [
         <#assign displayReturnField = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.autocompleter.displayReturnField")>
         <#list autocompleteOptions as autocompleteOption>
             {
             <#assign displayString = ""/>
             <#assign returnField = ""/>
-            <#-- <#list autocompleteOption.keySet() as key> instead use the field order of display fields -->
-                <#list displayFieldsSet as key>
-                <#assign field = autocompleteOption.get(key)?if_exists>
-                <#if field?has_content>
-                    <#if (key == context.returnField)>
-                        <#assign returnField = field/>
-                    <#else>
-                        <#assign displayString = displayString + field + " ">
-                    </#if>
-                </#if>
+            <#list displayFieldsSet as key>
+              <#assign field = autocompleteOption.get(key)?if_exists>
+              <#if field?has_content>
+                  <#if (key == context.returnField)>
+                      <#assign returnField = field/>
+                  <#else>
+                      <#assign displayString = displayString + field + " ">
+                  </#if>
+              </#if>
             </#list>
             <#if ("Y" == displayReturnField)>
                 <#assign displayString = displayString +  "[" + returnField + "]">
@@ -59,7 +58,7 @@ var autocomp = [
             "value": "${returnField}"
             }<#if autocompleteOption_has_next>,</#if>
         </#list>
+  ];
     </#if>
-];
 </script>
 </#if>