This change is not necessary. Please read my comment in the Jira issue.

Adrian Crum
Sandglass Software
www.sandglass-software.com

On 5/21/2015 6:45 AM, jler...@apache.org wrote:
Author: jleroux
Date: Thu May 21 13:45:02 2015
New Revision: 1680873

URL: http://svn.apache.org/r1680873
Log:
A patch from Gil Portenseigne for "Field Lookup do not show description when 
widget-verbose is set to false" https://issues.apache.org/jira/browse/OFBIZ-6396

When widget verbose is set to false and using field lookup, the description of 
the selected object is not displayed (not using auto completion but the popup).
To reproduce : Set widget.verbose=false in 
framework/widget/config/widget.properties
Clear OFBiz cache then go to : 
https://localhost:8443/partymgr/control/EditPartyRelationships?partyId=Company
In the partyRelationship creation form, in party Id From field, click on 
lookup, search, select AUTHOR_MADMAX, and so no description displayed. Using 
autocompletion it's fine.

This patch use a trick to no care about widgetVerbose comments. Sad to use this 
kind of trick, but if not, spaces might not be trimed. With that, the display 
is perfect. No side effect detected.

jleroux: I still regret Hans past attitude about widgetVerbose which initially 
forced me to this hack


Modified:
     ofbiz/trunk/framework/common/webcommon/includes/ajaxAutocompleteOptions.ftl
     ofbiz/trunk/framework/images/webapp/images/fieldlookup.js

Modified: 
ofbiz/trunk/framework/common/webcommon/includes/ajaxAutocompleteOptions.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/ajaxAutocompleteOptions.ftl?rev=1680873&r1=1680872&r2=1680873&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/includes/ajaxAutocompleteOptions.ftl 
(original)
+++ ofbiz/trunk/framework/common/webcommon/includes/ajaxAutocompleteOptions.ftl 
Thu May 21 13:45:02 2015
@@ -28,7 +28,7 @@ under the License.
                      </#if>
                  </#if>
              </#list>
-            <#if (displayString?trim?has_content )>${displayString?trim}</#if>
+            <#if (displayString?trim?has_content )><!-- displayString 
-->${displayString?trim}<!-- --></#if>
          </#list>
      </#if>
  <#else>

Modified: ofbiz/trunk/framework/images/webapp/images/fieldlookup.js
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/fieldlookup.js?rev=1680873&r1=1680872&r2=1680873&view=diff
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/fieldlookup.js (original)
+++ ofbiz/trunk/framework/images/webapp/images/fieldlookup.js Thu May 21 
13:45:02 2015
@@ -835,11 +835,8 @@ lookupDescriptionLoaded.prototype.update
              data : this.allParams,
              async : false,
              success : function(result) {
-                // This would be far more reliable if we were removing
-                // the widget boundaries in LookupDecorator using
-                // widgetVerbose in context :/
-                if (result.split("ajaxAutocompleteOptions.ftl -->")[1]) {
-                    setLookDescription(_fieldId, result.split("ajaxAutocompleteOptions.ftl 
-->")[1].trim().split("<!--")[0].trim(),
+                if (result.split("displayString -->")[1]) {
+                    setLookDescription(_fieldId, result.split("displayString 
-->")[1].trim().split("<!--")[0].trim(),
                              "", "");
                  }
              }


Reply via email to