[
https://jira.jboss.org/browse/RF-9305?page=com.atlassian.jira.plugin.syst...
]
Ilya Shaikovsky commented on RF-9305:
-------------------------------------
as I written at demo:
<p>Except the server-side <b>"autocomplete"</b> method which
could
be used to collect suggestion strings according to entered prefix,
<b>rich:autocomplete</b>
allows to define similar method for filtering at client side. It should
be defined using <b>clientFilterFunction</b> attribute which accepts
custom filter function name. Function should accepts two parameters
<b>subString</b>(current
input value considering tokens) and <b>value</b>(currently iterated
item value) and return boolean flag which means if the value satisfies
the substring passed. The function will be called for every available
suggestion in order to construct new list of suggestions.</p>
<p>This sample shows how to change the client filtering to
<b>"contains"</b>
instead of <b>"startsWith"</b></p>
and example:
<script>
function customFilter(subString, value){
if(subString.length>=1) {
if(value.indexOf(subString)!=-1)
return true;
}else return false;
};
</script>
<h:form>
<rich:autocomplete mode="client" minChars="0"
autofill="false"
clientFilter="customFilter"
autocompleteMethod="#{autocompleteBean.autocomplete}" />
</h:form>
Autocomplete: add information about clientFilter attribute
----------------------------------------------------------
Key: RF-9305
URL:
https://jira.jboss.org/browse/RF-9305
Project: RichFaces
Issue Type: Sub-task
Security Level: Public(Everyone can see)
Components: doc
Affects Versions: 4.0.0.Milestone2
Reporter: Pavel Yaschenko
Assignee: Ilya Shaikovsky
Fix For: 4.0.0.Milestone4
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira