Author: bibryam
Date: Sat Jan  9 10:27:49 2010
New Revision: 897412

URL: http://svn.apache.org/viewvc?rev=897412&view=rev
Log:
Added ajax autocompleter support to lookup screens in accounting, party, 
product and workeffort components.
Also added possibility for passing additional condition to search query. This 
can be seen in party lookup screens, used to filter disabled parties.
Specifying return field is not required any more - the first field from search 
fields is used as return field.

Added:
    
ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/StatusCondition.groovy
Modified:
    ofbiz/trunk/applications/accounting/widget/LookupScreens.xml
    ofbiz/trunk/applications/order/widget/ordermgr/LookupScreens.xml
    ofbiz/trunk/applications/party/widget/partymgr/LookupScreens.xml
    ofbiz/trunk/applications/product/widget/catalog/LookupScreens.xml
    ofbiz/trunk/applications/product/widget/facility/LookupScreens.xml
    ofbiz/trunk/applications/workeffort/widget/LookupScreens.xml
    
ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/FindAutocompleteOptions.groovy
    ofbiz/trunk/framework/common/widget/LookupScreens.xml

Modified: ofbiz/trunk/applications/accounting/widget/LookupScreens.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/LookupScreens.xml?rev=897412&r1=897411&r2=897412&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/LookupScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/LookupScreens.xml Sat Jan  9 
10:27:49 2010
@@ -33,6 +33,8 @@
                 <set field="queryString" from-field="result.queryString"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer" default-value="0"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
+                <set field="entityName" value="Payment"/>
+                <set field="searchFields" value="[paymentId, partyIdFrom, 
partyIdTo, currencyUomId]"/>                     
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -59,6 +61,8 @@
                 <set field="queryString" from-field="result.queryString"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer" default-value="0"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
+                <set field="entityName" value="Invoice"/>
+                <set field="searchFields" value="[invoiceId, partyIdFrom, 
partyId, description, currencyUomId]"/>                
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -83,6 +87,8 @@
                 <set field="queryString" from-field="result.queryString"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer" default-value="0"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
+                <set field="entityName" value="FixedAsset"/>
+                <set field="searchFields" value="[fixedAssetId, 
fixedAssetName, fixedAssetTypeId]"/>                 
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -106,11 +112,12 @@
             </condition>
             <actions>
                 <property-map resource="AccountingUiLabels" 
map-name="uiLabelMap" global="true"/>
-
                 <set field="title" 
value="${uiLabelMap.PageTitleLookupBillingAccount}"/>
                 <set field="queryString" from-field="result.queryString"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer" default-value="0"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
+                <set field="entityName" value="BillingAccount"/>
+                <set field="searchFields" value="[billingAccountId, 
description, externalAccountId, accountCurrencyUomId]"/>                
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -138,6 +145,8 @@
                 <set field="queryString" from-field="result.queryString"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer" default-value="0"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
+                <set field="entityName" value="GlAccount"/>
+                <set field="searchFields" value="[glAccountId, accountName, 
glAccountTypeId, glAccountClassId]"/>                
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -163,6 +172,8 @@
                 <set field="queryString" from-field="result.queryString"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer" default-value="0"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
+                <set field="entityName" value="Agreement"/>
+                <set field="searchFields" value="[agreementId, productId, 
description, agreementTypeId]"/>                
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -188,6 +199,8 @@
                 <set field="queryString" from-field="result.queryString"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer" default-value="0"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
+                <set field="entityName" value="Agreement"/>
+                <set field="searchFields" value="[agreementItemSeqId, 
agreementId, agreementItemTypeId, currencyUomId]"/>                
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -239,6 +252,8 @@
                 <set field="title" 
value="${uiLabelMap.AccountingLookupGlReconciliations}"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer" default-value="0"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
+                <set field="entityName" value="GlReconciliation"/>
+                <set field="searchFields" value="[glReconciliationId, 
glReconciliationName, description]"/>                
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">

Modified: ofbiz/trunk/applications/order/widget/ordermgr/LookupScreens.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/LookupScreens.xml?rev=897412&r1=897411&r2=897412&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/widget/ordermgr/LookupScreens.xml (original)
+++ ofbiz/trunk/applications/order/widget/ordermgr/LookupScreens.xml Sat Jan  9 
10:27:49 2010
@@ -36,6 +36,8 @@
                 <set field="queryString" from-field="result.queryString"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
+                <set field="entityName" value="OrderHeader"/>
+                <set field="searchFields" value="[orderId, orderName, 
orderTypeId]"/>                
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -63,6 +65,8 @@
                 <set field="queryString" from-field="result.queryString"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
+                <set field="entityName" value="OrderHeaderAndShipGroups"/>
+                <set field="searchFields" value="[orderId, toName, 
orderTypeId]"/>                
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -89,6 +93,8 @@
                 <set field="queryString" from-field="result.queryString"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
+                <set field="entityName" value="OrderHeaderAndShipGroups"/>
+                <set field="searchFields" value="[orderId, toName, 
orderTypeId]"/>                
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -173,6 +179,8 @@
                 <set field="queryString" from-field="result.queryString"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
+                <set field="entityName" value="Quote"/>
+                <set field="searchFields" value="[quoteId, quoteName, 
description]"/>                
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -200,6 +208,8 @@
                 <set field="queryString" from-field="result.queryString"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
+                <set field="entityName" value="QuoteItem"/>
+                <set field="searchFields" value="[quoteItemSeqId, quoteId, 
productId, comments]"/>                
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -226,6 +236,8 @@
                 <set field="queryString" from-field="result.queryString"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
+                <set field="entityName" value="Requirement"/>
+                <set field="searchFields" value="[requirementId, description, 
requirementTypeId]"/>                
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -252,6 +264,8 @@
                 <set field="queryString" from-field="result.queryString"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
+                <set field="entityName" value="ShoppingList"/>
+                <set field="searchFields" value="[shoppingListId, listName, 
description]"/>                
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">

Added: 
ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/StatusCondition.groovy
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/StatusCondition.groovy?rev=897412&view=auto
==============================================================================
--- 
ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/StatusCondition.groovy
 (added)
+++ 
ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/StatusCondition.groovy
 Sat Jan  9 10:27:49 2010
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+ 
+import org.ofbiz.entity.condition.*;
+ 
+exprList = [EntityCondition.makeCondition("statusId", 
EntityOperator.NOT_EQUAL, "PARTY_DISABLED"), 
+            EntityCondition.makeCondition("statusId", 
EntityOperator.NOT_EQUAL, null)];
+condList = EntityCondition.makeCondition(exprList, EntityOperator.AND);
+context.andCondition = EntityCondition.makeCondition([condList, 
EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, null)], 
EntityOperator.OR);
+ 
\ No newline at end of file

Modified: ofbiz/trunk/applications/party/widget/partymgr/LookupScreens.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/LookupScreens.xml?rev=897412&r1=897411&r2=897412&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/widget/partymgr/LookupScreens.xml (original)
+++ ofbiz/trunk/applications/party/widget/partymgr/LookupScreens.xml Sat Jan  9 
10:27:49 2010
@@ -37,15 +37,15 @@
                 <set field="entityName" value="PartyNameView"/>
                 
                 <!-- required: fields to search a match -->
+                <!-- the first element from searchFields is returned after 
user selection --> 
+                <!-- it might be hidden based on 
widget.autocompleter.displayReturnField property in widget.properties -->       
         
                 <set field="searchFields" value="[partyId, firstName, 
middleName, lastName, groupName]"/>
-                
-                <!-- optional: field to return after user selection, default 
is first element of searchFields --> 
-                <!-- return field might be hidden based on 
widget.autocompleter.displayReturnField property in widget.properties -->
-                <set field="returnField" value="partyId"/>                  
-                
-                <!-- optional: fields to display, default are searchFields -->
+ 
+                <!-- optional: fields to display in the given order, default 
is searchFields -->
                 <set field="displayFields" value="[firstName, lastName, 
groupName]"/>
                 
+                <!-- optional: additional entity condition (named 
andCondition) added to search query -->
+                <script 
location="component://party/webapp/partymgr/WEB-INF/actions/party/StatusCondition.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -141,9 +141,10 @@
             <actions>
                 <property-map resource="PartyUiLabels" map-name="uiLabelMap" 
global="true"/>
                 <set field="title" 
value="${uiLabelMap.PartyLookupPartyPerson}"/>
+                <set field="queryString" from-field="result.queryString"/>     
           
                 <set field="entityName" value="PartyAndPerson"/>
                 <set field="searchFields" value="[partyId, firstName, 
middleName, lastName]"/>
-                <set field="queryString" from-field="result.queryString"/>
+                <script 
location="component://party/webapp/partymgr/WEB-INF/actions/party/StatusCondition.groovy"/>
                
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -212,12 +213,13 @@
             </condition>
             <actions>
                 <property-map resource="PartyUiLabels" map-name="uiLabelMap" 
global="true"/>
-
                 <set field="title" 
value="${uiLabelMap.PartyLookupPartyAndUserLoginAndPerson}"/>
                 <set field="entityName" value="PartyAndUserLoginAndPerson"/>
                 <set field="queryString" from-field="result.queryString"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer" default-value="0"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
+                <set field="searchFields" value="[userLoginId, partyId, 
firstName, lastName]"/>
+                <script 
location="component://party/webapp/partymgr/WEB-INF/actions/party/StatusCondition.groovy"/>
                 
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -244,6 +246,8 @@
                 <set field="queryString" from-field="result.queryString"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer" default-value="0"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
+                <set field="searchFields" value="[userLoginId, partyId, 
firstName, lastName, groupName]"/>
+                <script 
location="component://party/webapp/partymgr/WEB-INF/actions/party/StatusCondition.groovy"/>
                
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -266,6 +270,8 @@
                 <property-map resource="PartyUiLabels" map-name="uiLabelMap" 
global="true"/>
                 <set field="title" 
value="${uiLabelMap.PartyLookupPartyGroup}"/>
                 <set field="entityName" value="PartyAndGroup"/>
+                <set field="searchFields" value="[partyId, groupName, 
comments]"/>
+                <script 
location="component://party/webapp/partymgr/WEB-INF/actions/party/StatusCondition.groovy"/>
                
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -311,8 +317,9 @@
             </condition>
             <actions>
                 <property-map resource="PartyUiLabels" map-name="uiLabelMap" 
global="true"/>
-
                 <set field="title" 
value="${uiLabelMap.PartyLookupPartyClassificationGroup}"/>
+                <set field="entityName" value="PartyClassificationGroup"/>
+                <set field="searchFields" value="[partyClassificationGroupId, 
parentGroupId, description]"/>                                
                 <set field="queryString" from-field="result.queryString"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer" default-value="0"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
@@ -335,7 +342,8 @@
             <actions>
                 <property-map resource="PartyUiLabels" map-name="uiLabelMap" 
global="true"/>
                 <property-map resource="MarketingUiLabels" 
map-name="uiLabelMap" global="true"/>
-
+                <set field="entityName" value="CommunicationEvent"/>
+                <set field="searchFields" value="[communicationEventId, 
subject]"/> 
                 <set field="title" 
value="${uiLabelMap.PartyLookupPartyCommEvent}"/>
                 <set field="tabButtonItem" value="ContactList"/>
             </actions>
@@ -359,6 +367,8 @@
 
                 <set field="title" 
value="${uiLabelMap.PartyLookupContactMech}"/>
                 <set field="entityName" value="PartyAndContactMech"/>
+                <set field="searchFields" value="[contactMechId, partyId, 
contactMechTypeId, infoString, paToName]"/> 
+                <script 
location="component://party/webapp/partymgr/WEB-INF/actions/party/StatusCondition.groovy"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer" default-value="0"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
             </actions>
@@ -385,6 +395,10 @@
                 <set field="title" 
value="${uiLabelMap.PartyLookupInternalOrganization}"/>
                 <set field="entityName" value="PartyRoleAndPartyDetail"/>
                 <set field="roleTypeId" value="INTERNAL_ORGANIZATIO"/>
+                <set field="searchFields" value="[partyId, groupName, 
partyGroupComments]"/>
+                <script 
location="component://party/webapp/partymgr/WEB-INF/actions/party/StatusCondition.groovy"/>
      
+                <set field="updateStatCond" value="${groovy: 
context.andCondition = 
org.ofbiz.entity.condition.EntityCondition.makeCondition([context.andCondition, 
+                    
org.ofbiz.entity.condition.EntityCondition.makeCondition(&quot;roleTypeId&quot;,
 &quot;INTERNAL_ORGANIZATIO&quot;)])}"/>
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">

Modified: ofbiz/trunk/applications/product/widget/catalog/LookupScreens.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/LookupScreens.xml?rev=897412&r1=897411&r2=897412&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/catalog/LookupScreens.xml (original)
+++ ofbiz/trunk/applications/product/widget/catalog/LookupScreens.xml Sat Jan  
9 10:27:49 2010
@@ -29,6 +29,8 @@
                 <property-map resource="ProductUiLabels" map-name="uiLabelMap" 
global="true"/>
                 <set field="title" 
value="${uiLabelMap.PageTitleLookupProduct}"/>
                 <set field="queryString" from-field="result.queryString"/>
+                <set field="entityName" value="Product"/>
+                <set field="searchFields" value="[productId, brandName, 
internalName, productTypeId]"/>                 
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -51,6 +53,9 @@
                 <property-map resource="ProductUiLabels" map-name="uiLabelMap" 
global="true"/>
                 <set field="title" 
value="${uiLabelMap.PageTitleLookupProductVirtual}"/>
                 <set field="queryString" from-field="result.queryString"/>
+                <set field="entityName" value="Product"/>
+                <set field="searchFields" value="[productId, brandName, 
internalName, productTypeId]"/>  
+                <set field="onlyVirtual" value="${groovy: context.andCondition 
= 
org.ofbiz.entity.condition.EntityCondition.makeCondition(&quot;isVirtual&quot;, 
&quot;Y&quot;)}"/>
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -99,6 +104,9 @@
                 <set field="title" 
value="${uiLabelMap.PageTitleLookupProductPrice}"/>
                 <set field="queryString" from-field="result.queryString"/>
                 <property-to-field field="defaultCurrencyUomId" 
resource="general" property="currency.uom.id.default" default="USD"/>
+                <set field="entityName" value="ProductAndPriceView"/>
+                <set field="searchFields" value="[productId, internalName, 
productTypeId]"/>     
+                <set field="displayFields" value="[productId, internalName, 
productTypeId, price, currencyUomId]"/>                           
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -121,6 +129,8 @@
                 <property-map resource="ProductUiLabels" map-name="uiLabelMap" 
global="true"/>
                 <set field="title" 
value="${uiLabelMap.PageTitleLookupProductCategory}"/>
                 <set field="queryString" from-field="result.queryString"/>
+                <set field="entityName" value="ProductCategory"/>
+                <set field="searchFields" value="[productCategoryId, 
categoryName, description, productCategoryTypeId]"/>                 
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -143,6 +153,8 @@
                 <property-map resource="ProductUiLabels" map-name="uiLabelMap" 
global="true"/>
                 <set field="title" 
value="${uiLabelMap.PageTitleLookupProductFeature}"/>
                 <set field="queryString" from-field="result.queryString"/>
+                <set field="entityName" value="ProductFeature"/>
+                <set field="searchFields" value="[productFeatureId, 
description, productFeatureCategoryId, productFeatureTypeId]"/>                
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -168,6 +180,8 @@
                 <set field="title" 
value="${uiLabelMap.PageTitleLookupProductStore}"/>
                 <set field="entityName" value="ProductStore"/>
                 <set field="queryString" from-field="result.queryString"/>
+                <set field="entityName" value="ProductStore"/>
+                <set field="searchFields" value="[productStoreId, companyName, 
storeName, primaryStoreGroupId]"/>                
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -192,6 +206,8 @@
                 <entity-one entity-name="PartyNameView" value-field="pnv"/>
                 <set field="title" 
value="${uiLabelMap.PageTitleLookupSupplierProduct} ${pnv.firstName} 
${pnv.middleName} ${pnv.lastName} ${pnv.groupName} [${parameters.partyId}]"/>
                 <set field="queryString" from-field="result.queryString"/>
+                <set field="entityName" value="SupplierProductAndProduct"/>
+                <set field="searchFields" value="[productId, partyId, 
brandName, internalName, productTypeId]"/>                
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">

Modified: ofbiz/trunk/applications/product/widget/facility/LookupScreens.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/LookupScreens.xml?rev=897412&r1=897411&r2=897412&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/facility/LookupScreens.xml 
(original)
+++ ofbiz/trunk/applications/product/widget/facility/LookupScreens.xml Sat Jan  
9 10:27:49 2010
@@ -31,6 +31,8 @@
                 <set field="queryString" from-field="result.queryString"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
+                <set field="entityName" value="Facility"/>
+                <set field="searchFields" value="[facilityId, facilityName, 
facilityTypeId]"/>                 
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -55,6 +57,8 @@
                 <set field="queryString" from-field="result.queryString"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
+                <set field="entityName" value="FacilityLocation"/>
+                <set field="searchFields" value="[locationSeqId, facilityId, 
locationTypeEnumId]"/>                 
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -78,6 +82,8 @@
                 <set field="queryString" from-field="result.queryString"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer" default-value="0"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
+                <set field="entityName" value="Shipment"/>
+                <set field="searchFields" value="[shipmentId, shipmentTypeId, 
statusId]"/>                 
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">

Modified: ofbiz/trunk/applications/workeffort/widget/LookupScreens.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/widget/LookupScreens.xml?rev=897412&r1=897411&r2=897412&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/widget/LookupScreens.xml (original)
+++ ofbiz/trunk/applications/workeffort/widget/LookupScreens.xml Sat Jan  9 
10:27:49 2010
@@ -29,11 +29,12 @@
             </condition>
             <actions>
                 <property-map resource="WorkEffortUiLabels" 
map-name="uiLabelMap" global="true"/>
-
                 <set field="title" 
value="${uiLabelMap.PageTitleLookupWorkEffort}"/>
                 <set field="queryString" from-field="result.queryString"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
+                <set field="entityName" value="WorkEffort"/>
+                <set field="searchFields" value="[workEffortId, 
workEffortName, workEffortTypeId]"/>                
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -57,11 +58,12 @@
             </condition>
             <actions>
                 <property-map resource="WorkEffortUiLabels" 
map-name="uiLabelMap" global="true"/>
-
                 <set field="title" 
value="${uiLabelMap.PageTitleLookupTimesheet}"/>
                 <set field="queryString" from-field="result.queryString"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
+                <set field="entityName" value="Timesheet"/>
+                <set field="searchFields" value="[timesheetId, partyId, 
clientPartyId, comments]"/>                
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
@@ -85,11 +87,12 @@
             </condition>
             <actions>
                 <property-map resource="WorkEffortUiLabels" 
map-name="uiLabelMap" global="true"/>
-
                 <set field="title" 
value="${uiLabelMap.PageTitleLookupWorkEffort}"/>
                 <set field="queryString" from-field="result.queryString"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
+                <set field="entityName" value="WorkEffort"/>
+                <set field="searchFields" value="[workEffortId, 
workEffortName, workEffortTypeId]"/>                
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">

Modified: 
ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/FindAutocompleteOptions.groovy
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/FindAutocompleteOptions.groovy?rev=897412&r1=897411&r2=897412&view=diff
==============================================================================
--- 
ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/FindAutocompleteOptions.groovy
 (original)
+++ 
ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/FindAutocompleteOptions.groovy
 Sat Jan  9 10:27:49 2010
@@ -36,7 +36,7 @@
 if (searchFields && fieldValue) {
     searchFieldsList = StringUtil.toList(searchFields);
     displayFieldsSet = StringUtil.toSet(displayFields);
-    returnField = context.returnField ?: searchFieldsList[0]; //default to 
first element of searchFields
+    returnField = searchFieldsList[0]; //default to first element of 
searchFields
     displayFieldsSet.add(returnField); //add it to select fields, in case it 
is missing
     context.returnField = returnField;
     context.displayFieldsSet = displayFieldsSet;
@@ -46,8 +46,14 @@
 }
 
 if (andExprs && entityName && displayFieldsSet) {
-    Integer autocompleterViewSize = 
Integer.valueOf(context.autocompleterViewSize ?: 10);    
     entityConditionList = EntityCondition.makeCondition(andExprs, 
EntityOperator.OR);
+    
+    //if there is an extra condition, add it to main condition 
+    if (context.andCondition && context.andCondition  instanceof 
EntityCondition) {
+        entityConditionList = 
EntityCondition.makeCondition(context.andCondition, entityConditionList);
+    }
+    
+    Integer autocompleterViewSize = 
Integer.valueOf(context.autocompleterViewSize ?: 10);     
     EntityFindOptions findOptions = new EntityFindOptions();
     findOptions.setMaxRows(autocompleterViewSize);
     autocompleteOptions = delegator.findList(entityName, entityConditionList, 
displayFieldsSet, StringUtil.toList(displayFields), findOptions, false);

Modified: ofbiz/trunk/framework/common/widget/LookupScreens.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/LookupScreens.xml?rev=897412&r1=897411&r2=897412&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/widget/LookupScreens.xml (original)
+++ ofbiz/trunk/framework/common/widget/LookupScreens.xml Sat Jan  9 10:27:49 
2010
@@ -26,11 +26,12 @@
         <section>
             <actions>
                 <property-map resource="MarketingUiLabels" 
map-name="uiLabelMap" global="true"/>
-
                 <set field="title" value="${uiLabelMap.PageTitleLookupGeo}"/>
                 <set field="queryString" from-field="result.queryString"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" 
type="Integer" default-value="20"/>
+                <set field="entityName" value="Geo"/>
+                <set field="searchFields" value="[geoId, geoName, geoTypeId, 
geoCode]"/>                
             </actions>
             <widgets>
                 <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">


Reply via email to