When deleting the last character (e.g. with backspace), the autocomplete method is not invoked. This can be a quite nasty issue in several situations.
Suppose the following scenario.
There are two autocomplete fields, one is street and the other is city. The idea is to present valid combinations of street and city according to a data base containing addresses. The query is done with likes on street and city.
Suppose the current fields contain for street “broadw” and for city “new yor”. The cursor is within street and the user enters an 'a', so the autocomplete method is called with “broadwa”. Now a query is invoked with “... street like 'broadwa%' and city like 'new yor%'.
This works perfectly unless the user starts to delete the last character of an autocomplete field. When the user starts to delete the characters for street, the last invocation for street is the 'b'. Now the user also deletes the 'b' but the bean has no idea about this fact.
If the user now switches to the city field and enters for example a 'k', the bean would assume that street is still 'b'. The query would now be “... street like 'b%' and city like 'new york%' which is wrong, because street is already empty.
Therefore I would propose that the autocomplete method is also called when the last character is deleted, i.e. with an empty string, so that it is clear for the underlying business logic that the field is empty.