To add ajax support to a lookup screen, you have to add two fields: entityName and searchFields. As a reference please check LookupPartyName and LookupPerson screens in party manager. You can see ajaxed lookups in action in any screen using form widgets and the above lookup screens (findInvocies screen in accounting for example). This commit also fixes a bug in controls.js from scriptaculous library, but I reported it in its project list and I will track it further. To hide the returned values (shown as [ID])from the autocompleter or change the number of items there, you have to modify widget.properties git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@894149 13f79535-47bb-0310-9956-ffa450edef68
44 lines
1.9 KiB
Plaintext
44 lines
1.9 KiB
Plaintext
<#--
|
|
Licensed to the Apache Software Foundation (ASF) under one
|
|
or more contributor license agreements. See the NOTICE file
|
|
distributed with this work for additional information
|
|
regarding copyright ownership. The ASF licenses this file
|
|
to you under the Apache License, Version 2.0 (the
|
|
"License"); you may not use this file except in compliance
|
|
with the License. You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing,
|
|
software distributed under the License is distributed on an
|
|
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
KIND, either express or implied. See the License for the
|
|
specific language governing permissions and limitations
|
|
under the License.
|
|
-->
|
|
|
|
<ul>
|
|
<#if autocompleteOptions?exists>
|
|
<#assign displayReturnField = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.autocompleter.displayReturnField")>
|
|
<#list autocompleteOptions as autocompleteOption>
|
|
<#assign displayString = ""/>
|
|
<#assign returnField = ""/>
|
|
<#-- <#list autocompleteOption.keySet() as key> instead use the field order of display fields -->
|
|
<#list context.displayFieldsSet as key>
|
|
<#assign field = autocompleteOption.get(key)?if_exists>
|
|
<#if field?has_content>
|
|
<#if (key == context.returnField)>
|
|
<#assign returnField = field/>
|
|
<#else>
|
|
<#assign displayString = displayString + field + " ">
|
|
</#if>
|
|
</#if>
|
|
</#list>
|
|
<#if ("Y" == displayReturnField)>
|
|
<#assign displayString = displayString + "[" + returnField + "]">
|
|
</#if>
|
|
<li id="${returnField}"><#if (displayString?trim?has_content )>${displayString?trim}<#else>${returnField}</#if></li>
|
|
</#list>
|
|
</#if>
|
|
</ul>
|