|
|
It is used to generate lookup fields.
please refer these files :
htmlTemplate.ftl macro for lookupfield :-
<#macro lookupField className="" alert="" name="" value="" size="20" maxlength="20" id="" event="" action="" readonly="" autocomplete="" descriptionFieldName="" formName="" fieldFormName="" targetParameterIter="" imgSrc="" ajaxUrl="" ajaxEnabled="" presentation="layer" width="" height="" position="topleft" fadeBackground="true" clearText="" showDescription="" initiallyCollapsed="">
<#if (!ajaxEnabled?has_content)>
<#assign javascriptEnabled = Static["org.ofbiz.base.util.UtilHttp"].isJavaScriptEnabled(request) />
<#if (javascriptEnabled)>
<#local ajaxEnabled = true>
</#if> </#if> <#if (!id?has_content)>
<#local id = Static["org.ofbiz.base.util.UtilHttp"].getNextUniqueId(request) />
</#if> <#if (!ajaxUrl?has_content)>
<#local ajaxUrl = requestAttributes._REQUEST_HANDLER_.makeLink(request, response, fieldFormName)/>
<#local ajaxUrl = id + "," + ajaxUrl + ",ajaxLookup=Y" />
</#if> <#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> <#if "true" == readonly>
<#local readonly = true/>
<#else>
<#local readonly = false />
</#if>
<@renderLookupField name formName fieldFormName className alert value size maxlength id event action readonly autocomplete descriptionFieldName targetParameterIter imgSrc ajaxUrl ajaxEnabled presentation width height position fadeBackground clearText showDescription initiallyCollapsed/>
</#macro>
htmlFormMacroLibrary.ftl read this for how it actually works: -
search for this in the file and go through it for better understanding
<#macro renderLookupField
Regards
Mohd Viqar
|