Author: jleroux
Date: Thu Dec 23 12:45:32 2010
New Revision: 1052245
URL:
http://svn.apache.org/viewvc?rev=1052245&view=revLog:
A patch from Chatree Srichart "Duplicate _LAST_VIEW_NAME_ query string in renderLookupField macro" (
https://issues.apache.org/jira/browse/OFBIZ-4072) - OFBIZ-4072
Problem in renderLookupField macro: duplicates LAST_VIEW_NAME query string when it's already in ajaxURL . This problem causes the request handler to not convert LAST_VIEW_NAME parameter to String because it would be List.
Modified:
ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
Modified: ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=1052245&r1=1052244&r2=1052245&view=diff==============================================================================
--- ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Thu Dec 23 12:45:32 2010
@@ -516,9 +516,9 @@ ${item.description}</span>
<#if disabled?has_content && disabled><a id="${id}_clear" style="background:none;margin-left:5px;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></#if>
</span>
<#if ajaxEnabled?has_content && ajaxEnabled>
- <#if parameters?has_content && parameters._LAST_VIEW_NAME_?has_content>
+ <#if parameters?has_content && parameters._LAST_VIEW_NAME_?has_content && ajaxUrl?index_of("_LAST_VIEW_NAME_") < 0>
<#local ajaxUrl = ajaxUrl + "&_LAST_VIEW_NAME_=" + parameters._LAST_VIEW_NAME_ />
- <#else>
+ <#elseif ajaxUrl?index_of("_LAST_VIEW_NAME_") < 0>
<#local ajaxUrl = ajaxUrl + "&_LAST_VIEW_NAME_=main"/>
</#if>
<script language="JavaScript" type="text/javascript">ajaxAutoCompleter('${ajaxUrl}', ${showDescription});</script><#t/>