Author: adrianc
Date: Sun Jul 3 16:48:56 2011
New Revision: 1142458
URL:
http://svn.apache.org/viewvc?rev=1142458&view=revLog:
Minor Ajax code improvement: The autocompleterViewSize widget.properties setting can be overridden in a screen.
Modified:
ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/FindAutocompleteOptions.groovy
ofbiz/trunk/framework/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=1142458&r1=1142457&r2=1142458&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 Sun Jul 3 16:48:56 2011
@@ -19,6 +19,7 @@
import org.ofbiz.base.util.StringUtil;
import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.UtilProperties;
import org.ofbiz.entity.util.EntityFindOptions;
import org.ofbiz.entity.condition.EntityCondition;
import org.ofbiz.entity.condition.EntityConditionList;
@@ -104,7 +105,11 @@ if (orExprs && entityName && displayFiel
def entityConditionList = EntityCondition.makeCondition(mainAndConds, EntityOperator.AND);
- Integer autocompleterViewSize = Integer.valueOf(context.autocompleterViewSize ?: 10);
+ String viewSizeStr = context.autocompleterViewSize;
+ if (viewSizeStr == null) {
+ viewSizeStr = UtilProperties.getPropertyValue("widget", "widget.autocompleter.defaultViewSize");
+ }
+ Integer autocompleterViewSize = Integer.valueOf(viewSizeStr ?: 10);
EntityFindOptions findOptions = new EntityFindOptions();
findOptions.setMaxRows(autocompleterViewSize);
findOptions.setDistinct(searchDistinct);
Modified: ofbiz/trunk/framework/common/widget/CommonScreens.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/CommonScreens.xml?rev=1142458&r1=1142457&r2=1142458&view=diff==============================================================================
--- ofbiz/trunk/framework/common/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/framework/common/widget/CommonScreens.xml Sun Jul 3 16:48:56 2011
@@ -348,7 +348,6 @@ under the License.
<section>
<actions>
<set field="searchType" from-field="parameters.searchType" default-value="${searchType}"/>
- <property-to-field resource="widget" property="widget.autocompleter.defaultViewSize" field="autocompleterViewSize"/>
<script location="component://common/webcommon/WEB-INF/actions/includes/FindAutocompleteOptions.groovy"/>
</actions>
<widgets>