From richfaces-svn-commits at lists.jboss.org Fri Oct 29 10:05:25 2010 Content-Type: multipart/mixed; boundary="===============5963093866587093029==" MIME-Version: 1.0 From: richfaces-svn-commits at lists.jboss.org To: richfaces-svn-commits at lists.jboss.org Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r19769 - in trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autocomplete: samples and 1 other directory. Date: Fri, 29 Oct 2010 10:05:24 -0400 Message-ID: <201010291405.o9TE5OfR001137@svn01.web.mwc.hst.phx2.redhat.com> --===============5963093866587093029== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ilya_shaikovsky Date: 2010-10-29 10:05:24 -0400 (Fri, 29 Oct 2010) New Revision: 19769 Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autocomplete= /clientFilter.xhtml trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autocomplete= /samples/clientFilter-sample.xhtml Log: https://jira.jboss.org/browse/RF-9305 Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autoc= omplete/clientFilter.xhtml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autocomplet= e/clientFilter.xhtml 2010-10-29 13:25:04 UTC (rev 19768) +++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autocomplet= e/clientFilter.xhtml 2010-10-29 14:05:24 UTC (rev 19769) @@ -8,13 +8,14 @@

Except the server-side "autocomplete" method which could be used to collect suggestion strings according to entered prefix, ric= h:autocomplete allows to define similar method for filtering at client side. It should - be defined using clientFilter attribute which accepts custom - filter function name. Function should accepts two parameters subString= - and value and return boolean value 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.

-

This sample shows how to change the client filtering to - "contains" instead of "startsWith"

+ be defined using clientFilterFunction attribute which accepts + custom filter function name. Function should accepts two parameters su= bString(current + input value considering tokens) and value(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.

+

This sample shows how to change the client filtering to "contains"<= /b> + instead of "startsWith"

Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autoc= omplete/samples/clientFilter-sample.xhtml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autocomplet= e/samples/clientFilter-sample.xhtml 2010-10-29 13:25:04 UTC (rev 19768) +++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autocomplet= e/samples/clientFilter-sample.xhtml 2010-10-29 14:05:24 UTC (rev 19769) @@ -5,9 +5,17 @@ xmlns:ui=3D"http://java.sun.com/jsf/facelets" xmlns:a4j=3D"http://richfaces.org/a4j" xmlns:rich=3D"http://richfaces.org/rich"> + =3D1) if(value.indexOf(subString)!= =3D-1) return true;" + clientFilter=3D"return customFilter(subString, value)" autocompleteMethod=3D"#{autocompleteBean.autocomplete}" /> \ No newline at end of file --===============5963093866587093029==--