Refactoring fieldlookup.js - step one: restructuring the lookup object, encapsulate some methods in objects

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1352804 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sascha Rodekamp
2012-06-22 08:48:58 +00:00
parent 4b8a5ac0fb
commit 38abbfc4c2
2 changed files with 813 additions and 753 deletions
File diff suppressed because it is too large Load Diff
@@ -652,23 +652,41 @@ Parameter: lastViewName, String, optional - If the ajaxEnabled parameter is true
</#if>
</#if>
</#if>
<script type="text/javascript">
<script type="text/javascript">
jQuery(document).ready(function(){
new ConstructLookup("${fieldFormName}", "${id}", document.${formName?html}.${name?html}, <#if descriptionFieldName?has_content>document.${formName?html}.${descriptionFieldName}<#else>null</#if>, "${formName?html}", "${width}", "${height}", "${position}", "${fadeBackground}", <#if ajaxEnabled?has_content && ajaxEnabled>"${ajaxUrl}", ${showDescription}<#else>"", false</#if>, "${presentation!}", "${defaultMinLength!2}", "${defaultDelay!300}"<#rt/>
<#if targetParameterIter?has_content>
<#assign isFirst = true>
<#lt/>, [<#rt/>
<#list targetParameterIter as item>
<#if isFirst>
<#lt/>document.${formName}.${item}<#rt/>
<#assign isFirst = false>
<#else>
<#lt/> ,document.${formName}.${item}<#rt/>
</#if>
</#list>
<#lt/>]<#rt/>
</#if>
<#lt/>);
var options = {
requestUrl : "${fieldFormName}",
inputFieldId : "${id}",
dialogTarget : document.${formName?html}.${name?html},
dialogOptionalTarget : <#if descriptionFieldName?has_content>document.${formName?html}.${descriptionFieldName}<#else>null</#if>,
formName : "${formName?html}",
width : "${width}",
height : "${height}",
position : "${position}",
modal : "${fadeBackground}",
ajaxUrl : <#if ajaxEnabled?has_content && ajaxEnabled>"${ajaxUrl}"<#else>""</#if>,
showDescription : <#if ajaxEnabled?has_content && ajaxEnabled>"${showDescription}"<#else>false</#if>,
presentation : "${presentation!}",
defaultMinLength : "${defaultMinLength!2}",
defaultDelay : "${defaultDelay!300}",
args : <#rt/>
<#if targetParameterIter?has_content>
<#assign isFirst = true>
<#lt/>, [<#rt/>
<#list targetParameterIter as item>
<#if isFirst>
<#lt/>document.${formName}.${item}<#rt/>
<#assign isFirst = false>
<#else>
<#lt/> ,document.${formName}.${item}<#rt/>
</#if>
</#list>
<#lt/>]<#rt/>
<#else>[]
</#if>
<#lt/>
};
new Lookup(options).init();
});
</script>
</#if>