Author: jjamrich
Date: 2011-11-06 20:18:03 -0500 (Sun, 06 Nov 2011)
New Revision: 22884
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richAutocomplete/filtering.xhtml
Log:
RFPL-1233: add client filtering example into autocomplete
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richAutocomplete/filtering.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richAutocomplete/filtering.xhtml 2011-11-07
01:17:54 UTC (rev 22883)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richAutocomplete/filtering.xhtml 2011-11-07
01:18:03 UTC (rev 22884)
@@ -37,24 +37,30 @@
</ui:define>
<ui:define name="head">
- <script>
- function clientFilterFunction(subString, value) {
- if (subString.length >= 1) {
- if(value.indexOf(subString)!=-1)
- return true;
- } else return false;
+ <script type="text/javascript">
+ /* function filtering by string occurence in state and name */
+ function customClientFilterFunction(subString, value) {
+
+ if (subString.length >= 2) {
+ if(value.indexOf(subString)!=-1) {
+ // console.log(' # ' + subString + ' matches on
' + value);
+ return true;
+ }
+ } else return false;
};
+
</script>
</ui:define>
<ui:define name="component">
+
<rich:autocomplete id="autocomplete"
-
autocompleteList="#{richAutocompleteBean.capitals}"
+
autocompleteList="#{richAutocompleteBean.capitals}"
autofill="#{richAutocompleteBean.attributes['autofill'].value}"
clientFilterFunction="#{richAutocompleteBean.attributes['clientFilterFunction'].value}"
converterMessage="#{richAutocompleteBean.attributes['converterMessage'].value}"
disabled="#{richAutocompleteBean.attributes['disabled'].value}"
-
filterFunction="#{richAutocompleteBean.attributes['filterFunction'].value}"
+ fetchValue="#{capital.state}"
immediate="#{richAutocompleteBean.attributes['immediate'].value}"
inputClass="#{richAutocompleteBean.attributes['inputClass'].value}"
layout="#{richAutocompleteBean.attributes['layout'].value}"
@@ -99,7 +105,9 @@
validatorMessage="#{richAutocompleteBean.attributes['validatorMessage'].value}"
value="#{richAutocompleteBean.attributes['value'].value}"
valueChangeListener="#{richBean.valueChangeListener}"
+ var="capital"
+ #{capital.name} of #{capital.state}
<a4j:ajax event="change"
render="#{richAutocompleteBean.ajaxAttributes['render'].value}"