maxschuster / Vaadin-AutocompleteTextField

A Vaadin TextField with autocomplete (aka word completion) functionality
https://vaadin.maxschuster.eu/AutocompleteTextField/
Apache License 2.0
9 stars 6 forks source link

Add-on doesn't work #5

Closed denis-anisimov closed 8 years ago

denis-anisimov commented 8 years ago

Use attached project. Type "a" in the textfield. Nothing happens. Suggestions don't appear. test.zip

maxschuster commented 8 years ago

Hi Denis,

you are missing this setting:

field.setMinChars(1);

By default, the threshold for auto completion is three letters.

denis-anisimov commented 8 years ago

Hi Max. OK, you are right, my bad. But it's not obvious. At least online demo works with one char but example source code on add-on page doesn't contain any mention about this. Would be good to add it to clarify this issue.

maxschuster commented 8 years ago

Thank you for your suggestion. I have added the available configuration options to the example code in the Directory:

// ===============================
// Available configuration options
// ===============================
field.setCache(true) // Client side should cache suggestions
field.setDelay(150) // Delay before sending a query to the server
field.setItemAsHtml(false) // Suggestions contain html formating. If true, make sure that the html is save to use!
field.setMinChars(3) // The required value length to trigger a query
field.setScrollBehavior(ScrollBehavior.NONE) // The method that should be used to compensate scrolling of the page
field.setSuggestionLimit(0) // The max amount of suggestions send to the client. If the limit is >= 0 no limit is applied
denis-anisimov commented 8 years ago

Very good. Thanks!