I've recently noticed that the autocompleter runs the getValues method twice for every search string. Therefore you can improve performance by almost 50% by adding some simple caching, especially if your search is driven externally (ie DB).

For example:

public class MyAutocompleteModel implements IAutocompleteModel
{
   private String lastFilter;
   private List<MyClass> lastResult;

...

   public List<MyClass> getValues(String filter)
   {
       if (EqualsUtils.equals(filter, lastFilter))
           return lastResult;

       List<MyClass> result = ......; // perform search

       lastFilter = filter;
       lastResult = result;
       return result;
   }

   ...
}


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to