Continued work done by Anil Patel about implementation of Ajax.Autocompleter enhancement for form widget text box.
There is now a generic screen (and controller entries) that can be used by Ajax autocompleter fields. See the example in the example component. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@659488 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import org.ofbiz.entity.GenericValue;
|
||||
import org.ofbiz.entity.model.DynamicViewEntity;
|
||||
import org.ofbiz.entity.model.ModelKeyMap;
|
||||
import org.ofbiz.entity.util.EntityFindOptions;
|
||||
import org.ofbiz.entity.util.EntityListIterator;
|
||||
import org.ofbiz.entity.condition.*;
|
||||
import org.ofbiz.entity.condition.EntityOperator;
|
||||
import org.ofbiz.entity.condition.EntityExpr;
|
||||
import org.ofbiz.base.util.*;
|
||||
import org.ofbiz.service.LocalDispatcher;
|
||||
|
||||
andExprs = new ArrayList();
|
||||
exampleFeatureId = request.getParameter("exampleFeatureId");
|
||||
if (exampleFeatureId != null && exampleFeatureId.length() > 0) {
|
||||
andExprs.add(new EntityExpr(new EntityFunction.UPPER(new EntityFieldValue("exampleFeatureId")),
|
||||
EntityOperator.LIKE, "%" + exampleFeatureId.toUpperCase() + "%"));
|
||||
}
|
||||
|
||||
if (andExprs.size() > 0){
|
||||
entityConditionList = new EntityConditionList(andExprs, EntityOperator.AND);
|
||||
List features = delegator.findByCondition("ExampleFeature", entityConditionList, null, UtilMisc.toList("-exampleFeatureId"));
|
||||
// exampleFeatureId list to use in form-widgets
|
||||
System.out.println("featuresfeatures" + features.size());
|
||||
context.put("listIt", features);
|
||||
}
|
||||
@@ -154,11 +154,6 @@ under the License.
|
||||
<response name="success" type="view" value="EditExampleFeatureExampleAppls"/>
|
||||
<response name="error" type="view" value="EditExampleFeatureExampleAppls"/>
|
||||
</request-map>
|
||||
<request-map uri="ExampleFeatureOptions">
|
||||
<security https="true" auth="true"/>
|
||||
<response name="success" type="view" value="ExampleFeatureOptions"/>
|
||||
<response name="error" type="view" value="ExampleFeatureOptions"/>
|
||||
</request-map>
|
||||
|
||||
<request-map uri="FormWidgetExamples"><security https="true" auth="true"/><response name="success" type="view" value="FormWidgetExamples"/></request-map>
|
||||
|
||||
@@ -183,7 +178,6 @@ under the License.
|
||||
<view-map name="FormWidgetExamples" type="screen" page="component://example/widget/example/FormWidgetExampleScreens.xml#FormWidgetExamples"/>
|
||||
|
||||
<view-map name="LookupExampleFeature" type="screen" page="component://example/widget/example/ExampleFeatureScreens.xml#LookupExampleFeature"/>
|
||||
<view-map name="ExampleFeatureOptions" type="screen" page="component://example/widget/example/ExampleFeatureScreens.xml#ExampleFeatureOptions"/>
|
||||
<!-- ajax view mappings -->
|
||||
<view-map name="findExampleAjax" type="screen" page="component://example/widget/example/ExampleAjaxScreens.xml#AjaxExample"/>
|
||||
<view-map name="ListExampleFormOnly" type="screen" page="component://example/widget/example/ExampleAjaxScreens.xml#ListExampleFormOnly"/>
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
<#--
|
||||
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. <#assign listIt = parameters.listIt>
|
||||
-->
|
||||
|
||||
<ul>
|
||||
<#list listIt as feature>
|
||||
<li>${feature.exampleFeatureId} <span class="informal"> ${feature.description}</span></li>
|
||||
</#list>
|
||||
</ul>
|
||||
Reference in New Issue
Block a user