I get "missing suggestion key {0}" error, here is how to reproduce it on the interface:
enter a text which has a not empty suggestion list (assume "test")
enter a text with an empty suggestion list
check that the suggestion extension is empty
push the keydown
check that you see previous suggestions (suggestions belonging to test)
click on a suggestion
check the "missing suggestion key {0}" exception on the log.
In other words, although the suggestions array is updated in the java code, it is possible to observe the previous suggestions on the UI. If you select from the previous suggestions, it cannot find the key on the current suggestions list and gives this error. Here is the text field implementation:
public AutocompleteTextField createEditor() {
field = new AutocompleteTextField(getLabel());
if (getValue() != null) {
field.setValue(getValue());
}
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(0); // 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(50); // The max amount of suggestions send to the client. If the limit is >= 0 no limit is applied
field.setRequiredIndicatorVisible(isMandatory());
// update the suggestions with respect to the text entered at text field
field.setSuggestionProvider(query -> fetchSuggestions(query.getTerm()));
field.addSelectListener((AutocompleteEvents.SelectListener) event -> onSuggestionSelection(event.getSuggestion()));
field.addValueChangeListener(event -> setValue(event.getValue()));
return field;
}
I would really appreciate it if you could help. Also thanks for the useful plug in :)
Hello,
I get "missing suggestion key {0}" error, here is how to reproduce it on the interface:
enter a text which has a not empty suggestion list (assume "test")
enter a text with an empty suggestion list
check that the suggestion extension is empty
push the keydown
check that you see previous suggestions (suggestions belonging to test)
click on a suggestion
check the "missing suggestion key {0}" exception on the log.
In other words, although the suggestions array is updated in the java code, it is possible to observe the previous suggestions on the UI. If you select from the previous suggestions, it cannot find the key on the current suggestions list and gives this error. Here is the text field implementation:
I would really appreciate it if you could help. Also thanks for the useful plug in :)