svn commit: r933130 - in /ofbiz/trunk/framework: common/webcommon/WEB-INF/actions/includes/ common/webcommon/includes/ common/widget/ example/widget/example/ images/webapp/images/ widget/config/ widget/src/org/ofbiz/widget/form/ widget/templates/

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

svn commit: r933130 - in /ofbiz/trunk/framework: common/webcommon/WEB-INF/actions/includes/ common/webcommon/includes/ common/widget/ example/widget/example/ images/webapp/images/ widget/config/ widget/src/org/ofbiz/widget/form/ widget/templates/

bibryam
Author: bibryam
Date: Mon Apr 12 07:54:10 2010
New Revision: 933130

URL: http://svn.apache.org/viewvc?rev=933130&view=rev
Log:
A patch from OFBIZ-3555 "Show lookup value descriptions". This enhancements allows displaying a description for the IDs in lookup fields. To enable this feature set widget.lookup.showDescription to Y in widget.properties

Modified:
    ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/FindAutocompleteOptions.groovy
    ofbiz/trunk/framework/common/webcommon/includes/htmlTemplate.ftl
    ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl
    ofbiz/trunk/framework/common/widget/CommonScreens.xml
    ofbiz/trunk/framework/example/widget/example/FormWidgetExampleLookupScreens.xml
    ofbiz/trunk/framework/images/webapp/images/fieldlookup.js
    ofbiz/trunk/framework/images/webapp/images/selectall.js
    ofbiz/trunk/framework/widget/config/widget.properties
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java
    ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl
    ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl
    ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
    ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl
    ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl

Modified: ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/FindAutocompleteOptions.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/FindAutocompleteOptions.groovy?rev=933130&r1=933129&r2=933130&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/FindAutocompleteOptions.groovy (original)
+++ ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/FindAutocompleteOptions.groovy Mon Apr 12 07:54:10 2010
@@ -32,10 +32,8 @@ searchFields = context.searchFields;
 displayFields = context.displayFields ?: searchFields;
 searchValueFieldName = parameters.searchValueField;
 fieldValue = parameters.get(searchValueFieldName);
-searchTypeStartWith = context.searchTypeStartWith;
-if( searchTypeStartWith == null){
-    searchTypeStartWith = "N";
-}
+searchType = context.searchType;
+
 if (searchFields && fieldValue) {
     searchFieldsList = StringUtil.toList(searchFields);
     displayFieldsSet = StringUtil.toSet(displayFields);
@@ -43,13 +41,19 @@ if (searchFields && fieldValue) {
     displayFieldsSet.add(returnField); //add it to select fields, in case it is missing
     context.returnField = returnField;
     context.displayFieldsSet = displayFieldsSet;
-    if ("Y".equals(searchTypeStartWith.toUpperCase())) {
+    if ("STARTS_WITH".equals(searchType)) {
         searchValue = fieldValue.toUpperCase() + "%";
-    } else {
+    } else if ("EQUALS".equals(searchType)) {
+        searchValue = fieldValue;
+    } else {//default is CONTAINS
         searchValue = "%" + fieldValue.toUpperCase() + "%";
     }
     searchFieldsList.each { fieldName ->
-        andExprs.add(EntityCondition.makeCondition(EntityFunction.UPPER(EntityFieldValue.makeFieldValue(fieldName)), EntityOperator.LIKE, searchValue));
+        if ("EQUALS".equals(searchType)) {
+            andExprs.add(EntityCondition.makeCondition(EntityFieldValue.makeFieldValue(fieldName), EntityOperator.EQUALS, searchValue));    
+        } else {
+            andExprs.add(EntityCondition.makeCondition(EntityFunction.UPPER(EntityFieldValue.makeFieldValue(fieldName)), EntityOperator.LIKE, searchValue));
+        }        
     }
 }
 

Modified: ofbiz/trunk/framework/common/webcommon/includes/htmlTemplate.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/htmlTemplate.ftl?rev=933130&r1=933129&r2=933130&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/includes/htmlTemplate.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/includes/htmlTemplate.ftl Mon Apr 12 07:54:10 2010
@@ -19,7 +19,7 @@ under the License.
 
 <#include "component://widget/templates/htmlFormMacroLibrary.ftl"/>
 
-<#macro lookupField className="" alert="" name="" value="" size="20" maxlength="20" id="" event="" action="" disabled="" autocomplete="" descriptionFieldName="" formName="" fieldFormName="" targetParameterIter="" imgSrc="" ajaxUrl="" ajaxEnabled="" presentation="" width="20" height="20" position="20" fadeBackground="" clearText="">
+<#macro lookupField className="" alert="" name="" value="" size="20" maxlength="20" id="" event="" action="" disabled="" autocomplete="" descriptionFieldName="" formName="" fieldFormName="" targetParameterIter="" imgSrc="" ajaxUrl="" ajaxEnabled="" presentation="" width="20" height="20" position="20" fadeBackground="" clearText="" showDescription="">
     <#if (!ajaxEnabled?has_content)>
         <#assign javascriptEnabled = Static["org.ofbiz.base.util.UtilHttp"].isJavaScriptEnabled(request) />
         <#if (javascriptEnabled)>
@@ -33,7 +33,15 @@ under the License.
         <#local ajaxUrl = requestAttributes._REQUEST_HANDLER_.makeLink(request, response, fieldFormName)/>
         <#local ajaxUrl = id + "," + ajaxUrl + ",ajaxLookup=Y&amp;searchValueField=" + name />
     </#if>
-    <@renderLookupField className alert name value size maxlength id event action disabled autocomplete descriptionFieldName formName fieldFormName targetParameterIter imgSrc ajaxUrl ajaxEnabled presentation width height position fadeBackground clearText />
+    <#if (!showDescription?has_content)>
+        <#local showDescription = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.lookup.showDescription", "N")>
+        <#if "Y" == showDescription>
+            <#local showDescription = "true" />
+        <#else>
+            <#local showDescription = "false" />
+        </#if>
+    </#if>
+    <@renderLookupField className alert name value size maxlength id event action disabled autocomplete descriptionFieldName formName fieldFormName targetParameterIter imgSrc ajaxUrl ajaxEnabled presentation width height position fadeBackground clearText showDescription/>
 </#macro>
 
 <#macro nextPrev commonUrl="" ajaxEnabled=false javaScriptEnabled=false paginateStyle="nav-pager" paginateFirstStyle="nav-first" viewIndex=0 highIndex=0 listSize=0 viewSize=1 ajaxFirstUrl="" firstUrl="" paginateFirstLabel="" paginatePreviousStyle="nav-previous" ajaxPreviousUrl="" previousUrl="" paginatePreviousLabel="" pageLabel="" ajaxSelectUrl="" selectUrl="" ajaxSelectSizeUrl="" selectSizeUrl="" commonDisplaying="" paginateNextStyle="nav-next" ajaxNextUrl="" nextUrl="" paginateNextLabel="" paginateLastStyle="nav-last" ajaxLastUrl="" lastUrl="" paginateLastLabel="" paginateViewSizeLabel="" >

Modified: ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl?rev=933130&r1=933129&r2=933130&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl Mon Apr 12 07:54:10 2010
@@ -89,6 +89,7 @@ under the License.
                 if (!obj_caller) return;
                 setSourceColor(obj_caller.target);
                 obj_caller.target.value = value;
+                obj_caller.target.fire("lookup:changed");
                 if (obj_caller.target.onchange != null) {
                     obj_caller.target.onchange();                      
                 }
@@ -101,6 +102,7 @@ under the License.
                 if (obj_caller.target2 == null) return;
                 setSourceColor(obj_caller.target2);
                 obj_caller.target2.value = value2;
+                obj_caller.target2.fire("lookup:changed");
                 if (obj_caller.target2.onchange != null) {
                     obj_caller.target2.onchange();
                 }

Modified: ofbiz/trunk/framework/common/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/CommonScreens.xml?rev=933130&r1=933129&r2=933130&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/framework/common/widget/CommonScreens.xml Mon Apr 12 07:54:10 2010
@@ -277,6 +277,7 @@ under the License.
             <fail-widgets>
                 <section>
                     <actions>
+                        <set field="searchType" from-field="parameters.searchType" default-value="${searchType}"/>
                         <property-to-field resource="widget" property="widget.autocompleter.defaultViewSize" field="autocompleterViewSize"/>
                         <script location="component://common/webcommon/WEB-INF/actions/includes/FindAutocompleteOptions.groovy"/>
                     </actions>
@@ -340,6 +341,7 @@ under the License.
             <fail-widgets>
                 <section>
                     <actions>
+                        <set field="searchType" from-field="parameters.searchType" default-value="${searchType}"/>
                         <property-to-field resource="widget" property="widget.autocompleter.defaultViewSize" field="autocompleterViewSize"/>
                         <script location="component://common/webcommon/WEB-INF/actions/includes/FindAutocompleteOptions.groovy"/>
                     </actions>

Modified: ofbiz/trunk/framework/example/widget/example/FormWidgetExampleLookupScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/widget/example/FormWidgetExampleLookupScreens.xml?rev=933130&r1=933129&r2=933130&view=diff
==============================================================================
--- ofbiz/trunk/framework/example/widget/example/FormWidgetExampleLookupScreens.xml (original)
+++ ofbiz/trunk/framework/example/widget/example/FormWidgetExampleLookupScreens.xml Mon Apr 12 07:54:10 2010
@@ -43,7 +43,7 @@ under the License.
 
                 <!--  when set Y the auto-completer will search value using "fieldValue%"(statrWith operation)-->
                 <!--  the default behavior is "%fieldValue%" (contains operation) -->
-                <set field="searchTypeStartWith" value="Y"/>
+                <set field="searchType" value="STARTS_WITH"/>
 
                 <!-- optional: fields to display in the given order, default is searchFields -->
                 <set field="displayFields" value="[firstName, lastName, groupName]"/>

Modified: ofbiz/trunk/framework/images/webapp/images/fieldlookup.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/fieldlookup.js?rev=933130&r1=933129&r2=933130&view=diff
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/fieldlookup.js (original)
+++ ofbiz/trunk/framework/images/webapp/images/fieldlookup.js Mon Apr 12 07:54:10 2010
@@ -733,13 +733,14 @@ function write_value (value, target) {
     
     setSourceColor(target);
     target.value = value;
-    
+    target.fire("lookup:changed");
     if (target.onchange != null) {    
         target.onchange();                    
     }
 }
 function set_multivalues(value) {
     obj_caller.target.value = value;
+    obj_caller.target.fire("lookup:changed");
     var thisForm = obj_caller.target.form;
     var evalString = "";
     
@@ -761,4 +762,40 @@ function closeLookup() {
         obj = GLOBAL_LOOKUP_REF.getReference(ACTIVATED_LOOKUP);
         obj.closeLookup();
     }
-}
\ No newline at end of file
+}
+
+//load description for lookup fields
+var lookupDescriptionLoaded = Class.create({
+    initialize: function(fieldId, url, params) {
+        this.fieldId = fieldId;
+        this.url = url;
+        this.params = params;
+        this.updateLookup();
+        $(fieldId).observe('change', this.updateLookup.bind(this));
+        $(fieldId).observe('lookup:changed', this.updateLookup.bind(this));
+    },
+
+    updateLookup: function() {
+        var tooltipElement = $(this.fieldId + '_lookupDescription');
+        if (tooltipElement) {//first remove current description
+            tooltipElement.remove();
+        }
+        if (!$F(this.fieldId)) {
+            return;
+        }
+        //actual server call
+        var allParams = this.params + '&' + $(this.fieldId).serialize() + '&' + 'searchType=EQUALS'
+        new Ajax.Request(this.url,{parameters: allParams, onSuccess: this.updateFunction.bind(this)});
+    },
+    
+    updateFunction: function(transport) {
+        var wrapperElement = new Element('div').insert(transport.responseText);
+        if('UL'!= wrapperElement.firstDescendant().tagName || (wrapperElement.firstDescendant().childElements().length != 1)) {    
+            //alert(transport.responseText); response is error or more than one entries are found
+            return;
+        }
+        Element.cleanWhitespace(wrapperElement);
+        Element.cleanWhitespace(wrapperElement.down());
+        setLookDescription(this.fieldId, wrapperElement.firstDescendant().firstDescendant().textContent);
+    }            
+});
\ No newline at end of file

Modified: ofbiz/trunk/framework/images/webapp/images/selectall.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/selectall.js?rev=933130&r1=933129&r2=933130&view=diff
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/selectall.js (original)
+++ ofbiz/trunk/framework/images/webapp/images/selectall.js Mon Apr 12 07:54:10 2010
@@ -329,19 +329,42 @@ function ajaxSubmitFormUpdateAreas(form,
   * @param areaCsvString The area CSV string. The CSV string is a flat array in the
   * form of: areaId, target, target parameters [, areaId, target, target parameters...].
 */
-function ajaxAutoCompleter(areaCsvString) {
+function ajaxAutoCompleter(areaCsvString, showDescription) {
     var areaArray = areaCsvString.replace('&amp;','&').split(",");
     var numAreas = parseInt(areaArray.length / 3);
     for (var i = 0; i < numAreas * 3; i = i + 3) {
         var optionsDivId = areaArray[i] + "_autoCompleterOptions";
         var indicatorId = areaArray[i] + "_indicator";
         $(areaArray[i]).insert({after: '<div class="autocomplete"' + 'id=' + optionsDivId + '></div>'});
-        new Ajax.Autocompleter($(areaArray[i]), optionsDivId, areaArray[i + 1], {parameters: areaArray[i + 2], indicator: indicatorId, afterUpdateElement : getSelectionId});
+        new Ajax.Autocompleter($(areaArray[i]), optionsDivId, areaArray[i + 1], {parameters: areaArray[i + 2], indicator: indicatorId, afterUpdateElement : setSelection});
+        if (showDescription) {
+            new lookupDescriptionLoaded(areaArray[i], areaArray[i + 1], areaArray[i + 2]);
+        }
     }
 }
 
-function getSelectionId(text, li) {
+function setSelection(text, li) {
     text.value = li.id;
+    var delay = function() { text.fire("lookup:changed"); };
+    setTimeout(delay, 100);
+}
+
+function setLookDescription(textFieldId, description) {
+    if (description) {
+        var start = description.lastIndexOf(' [');
+        if (start != -1) {
+            description = description.substring(0, start);
+        }
+    }
+    var ulElement = $(textFieldId).up('ul');
+    if (ulElement) {
+        var tooltipElement = $(textFieldId + '_lookupDescription');
+        if (!tooltipElement) {
+            tooltipElement = new Element('li', {id : textFieldId + '_lookupDescription', class : 'tooltip'});    
+        }
+        tooltipElement.update(description);
+        ulElement.appendChild(tooltipElement);
+    }
 }
 
 /** Enable auto-completion for drop-down elements.

Modified: ofbiz/trunk/framework/widget/config/widget.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/config/widget.properties?rev=933130&r1=933129&r2=933130&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/config/widget.properties (original)
+++ ofbiz/trunk/framework/widget/config/widget.properties Mon Apr 12 07:54:10 2010
@@ -32,6 +32,9 @@ widget.autocompleter.defaultViewSize=10
 # Show/hide the ID field that is returned from ajax autocompleter
 widget.autocompleter.displayReturnField=Y
 
+# Show/hide description for lookup field
+widget.lookup.showDescription=N
+
 # Default text find field's option
 widget.form.defaultTextFindOption=contains
 

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java?rev=933130&r1=933129&r2=933130&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java Mon Apr 12 07:54:10 2010
@@ -2010,6 +2010,8 @@ public class MacroFormRenderer implement
             Debug.logWarning("Could not find uiLabelMap in context", module);
         }
 
+        boolean showDescription = "Y".equals(UtilProperties.getPropertyValue("widget", "widget.lookup.showDescription", "N"));
+
         StringWriter sr = new StringWriter();
         sr.append("<@renderLookupField ");
         sr.append(" className=\"");
@@ -2063,8 +2065,10 @@ public class MacroFormRenderer implement
         sr.append(lookupPosition);
         sr.append("\" fadeBackground=\"");
         sr.append(fadeBackground);
-        sr.append("\" clearText=\"");
+        sr.append("\" clearText=\"");        
         sr.append(clearText);
+        sr.append("\" showDescription=\"");
+        sr.append(Boolean.toString(showDescription));
         sr.append("\" />");
         executeMacro(writer, sr.toString());
 

Modified: ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl?rev=933130&r1=933129&r2=933130&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl Mon Apr 12 07:54:10 2010
@@ -103,7 +103,7 @@ under the License.
 <@renderField value />
 </#macro>
 
-<#macro renderLookupField className alert name value size maxlength id event action disabled autocomplete descriptionFieldName formName fieldFormName targetParameterIter imgSrc ajaxUrl ajaxEnabled presentation width height position fadeBackground></#macro>
+<#macro renderLookupField className alert name value size maxlength id event action disabled autocomplete descriptionFieldName formName fieldFormName targetParameterIter imgSrc ajaxUrl ajaxEnabled presentation width height position fadeBackground showDescription></#macro>
 <#macro renderNextPrev paginateStyle paginateFirstStyle viewIndex highIndex listSize viewSize ajaxEnabled javaScriptEnabled ajaxFirstUrl firstUrl paginateFirstLabel paginatePreviousStyle ajaxPreviousUrl previousUrl paginatePreviousLabel pageLabel ajaxSelectUrl selectUrl ajaxSelectSizeUrl selectSizeUrl commonDisplaying paginateNextStyle ajaxNextUrl nextUrl paginateNextLabel paginateLastStyle ajaxLastUrl lastUrl paginateLastLabel paginateViewSizeLabel></#macro>
 <#macro renderFileField className alert name value size maxlength autocomplete><@renderField value /></#macro>
 <#macro renderPasswordField className alert name value size maxlength id autocomplete></#macro>

Modified: ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl?rev=933130&r1=933129&r2=933130&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl Mon Apr 12 07:54:10 2010
@@ -122,7 +122,7 @@ under the License.
 <@makeBlock className value />
 </#macro>
 
-<#macro renderLookupField className alert name value size maxlength id event action disabled autocomplete descriptionFieldName formName fieldFormName targetParameterIter imgSrc ajaxUrl ajaxEnabled presentation width height position fadeBackground></#macro>
+<#macro renderLookupField className alert name value size maxlength id event action disabled autocomplete descriptionFieldName formName fieldFormName targetParameterIter imgSrc ajaxUrl ajaxEnabled presentation width height position fadeBackground showDescription></#macro>
 <#macro renderNextPrev paginateStyle paginateFirstStyle viewIndex highIndex listSize viewSize ajaxEnabled javaScriptEnabled ajaxFirstUrl firstUrl paginateFirstLabel paginatePreviousStyle ajaxPreviousUrl previousUrl paginatePreviousLabel pageLabel ajaxSelectUrl selectUrl ajaxSelectSizeUrl selectSizeUrl commonDisplaying paginateNextStyle ajaxNextUrl nextUrl paginateNextLabel paginateLastStyle ajaxLastUrl lastUrl paginateLastLabel paginateViewSizeLabel></#macro>
 <#macro renderFileField className alert name value size maxlength autocomplete><@makeBlock className value /></#macro>
 <#macro renderPasswordField className alert name value size maxlength id autocomplete><@makeBlock className "" /></#macro>

Modified: ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=933130&r1=933129&r2=933130&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Mon Apr 12 07:54:10 2010
@@ -60,7 +60,7 @@ under the License.
     <#if clientAutocomplete?has_content && clientAutocomplete=="false"> autocomplete="off"</#if><#rt/>
     /><#t/>
     <#if ajaxEnabled?has_content && ajaxEnabled>
-        <script language="JavaScript" type="text/javascript">ajaxAutoCompleter('${ajaxUrl}');</script><#lt/>
+        <script language="JavaScript" type="text/javascript">ajaxAutoCompleter('${ajaxUrl}', false);</script><#lt/>
     </#if>
 </#macro>
 
@@ -438,7 +438,7 @@ ${item.description}</div>
 </#if>
 </#macro>
 
-<#macro renderLookupField className alert name value size maxlength id event action disabled autocomplete descriptionFieldName formName fieldFormName targetParameterIter imgSrc ajaxUrl ajaxEnabled presentation width height position fadeBackground clearText>
+<#macro renderLookupField className alert name value size maxlength id event action disabled autocomplete descriptionFieldName formName fieldFormName targetParameterIter imgSrc ajaxUrl ajaxEnabled presentation width height position fadeBackground clearText showDescription>
 <div class="field-lookup"><ul>
 <#if size?has_content && size=="0"><li><input type="hidden" <#if name?has_content> name="${name}"/></#if></li><#else><li><input type="text" <@renderClass className alert /><#if name?has_content> name="${name}"</#if><#if value?has_content> value="${value}"</#if><#if size?has_content> size="${size}"</#if><#if maxlength?has_content> maxlength="${maxlength}"</#if><#if id?has_content> id="${id}"</#if><#rt/><#if disabled?has_content && disabled> disabled="disabled"</#if><#rt/><#if event?has_content && action?has_content> ${event}="${action}"</#if><#rt/><#if autocomplete?has_content> autocomplete="off"</#if>/><#rt/></li></#if>
 <li><#if presentation?has_content && descriptionFieldName?has_content && presentation == "layer">
@@ -461,7 +461,7 @@ ${item.description}</div>
 <#if disabled?has_content && disabled><li><a id="${id}_clear" style="background:none;margin-left:-6px;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></li></#if>
 </ul></div>
 <#if ajaxEnabled?has_content && ajaxEnabled>
-    <script language="JavaScript" type="text/javascript">ajaxAutoCompleter('${ajaxUrl}');</script><#t/>
+    <script language="JavaScript" type="text/javascript">ajaxAutoCompleter('${ajaxUrl}', ${showDescription});</script><#t/>
 </#if>
 </#macro>
 

Modified: ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl?rev=933130&r1=933129&r2=933130&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl Mon Apr 12 07:54:10 2010
@@ -103,7 +103,7 @@ under the License.
 <@renderField value />
 </#macro>
 
-<#macro renderLookupField className alert name value size maxlength id event action disabled autocomplete descriptionFieldName formName fieldFormName targetParameterIter imgSrc ajaxUrl ajaxEnabled presentation width height position fadeBackground><@renderField value /></#macro>
+<#macro renderLookupField className alert name value size maxlength id event action disabled autocomplete descriptionFieldName formName fieldFormName targetParameterIter imgSrc ajaxUrl ajaxEnabled presentation width height position fadeBackground showDescription><@renderField value /></#macro>
 <#macro renderNextPrev paginateStyle paginateFirstStyle viewIndex highIndex listSize viewSize ajaxEnabled javaScriptEnabled ajaxFirstUrl firstUrl paginateFirstLabel paginatePreviousStyle ajaxPreviousUrl previousUrl paginatePreviousLabel pageLabel ajaxSelectUrl selectUrl ajaxSelectSizeUrl selectSizeUrl commonDisplaying paginateNextStyle ajaxNextUrl nextUrl paginateNextLabel paginateLastStyle ajaxLastUrl lastUrl paginateLastLabel paginateViewSizeLabel></#macro>
 <#macro renderFileField className alert name value size maxlength autocomplete><@renderField value /></#macro>
 <#macro renderPasswordField className alert name value size maxlength id autocomplete></#macro>

Modified: ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl?rev=933130&r1=933129&r2=933130&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl Mon Apr 12 07:54:10 2010
@@ -96,7 +96,7 @@ under the License.
 <#macro renderRangeFindField className alert name value size maxlength autocomplete titleStyle defaultOptionFrom opEquals opGreaterThan opGreaterThanEquals opLessThan opLessThanEquals value2 defaultOptionThru>
 </#macro>
 
-<#macro renderLookupField className alert name value size maxlength id event action disabled autocomplete descriptionFieldName formName fieldFormName targetParameterIter imgSrc ajaxUrl ajaxEnabled presentation width height position fadeBackground></#macro>
+<#macro renderLookupField className alert name value size maxlength id event action disabled autocomplete descriptionFieldName formName fieldFormName targetParameterIter imgSrc ajaxUrl ajaxEnabled presentation width height position fadeBackground showDescription></#macro>
 <#macro renderNextPrev paginateStyle paginateFirstStyle viewIndex highIndex listSize viewSize ajaxEnabled javaScriptEnabled ajaxFirstUrl firstUrl paginateFirstLabel paginatePreviousStyle ajaxPreviousUrl previousUrl paginatePreviousLabel pageLabel ajaxSelectUrl selectUrl ajaxSelectSizeUrl selectSizeUrl commonDisplaying paginateNextStyle ajaxNextUrl nextUrl paginateNextLabel paginateLastStyle ajaxLastUrl lastUrl paginateLastLabel paginateViewSizeLabel></#macro>
 <#macro renderFileField className alert name value size maxlength autocomplete></#macro>
 <#macro renderPasswordField className alert name value size maxlength id autocomplete></#macro>