From the sample code on https://vaadin.com/directory#!addon/autocomplete-extension it seems this must be one of the easiest addons to use, and still I fail … :—(
I’m running Vaadin 8.0.3 with Spring Boot 1.5.2 as per Spring Initializr +
<dependency>
<groupId>org.vaadin.spring.addons</groupId>
<artifactId>vaadin-spring-addon-sidebar</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
I have a View that starts out like this
@SpringComponent
@SpringView(name = DefaultViewComponent.VIEW_NAME)
@SideBarItem(sectionId = Sections.CUSTOMERS, caption = "Customers", order = 1)
@FontAwesomeIcon(FontAwesome.DATABASE)
@ViewScope
@Slf4j
public class DefaultViewComponent extends DefaultView implements View {
...
private TextField txtSearch = new TextField();
private AutocompleteExtension<String> extSearch = new AutocompleteExtension<>(txtSearch);
...
@Override public void enter(ViewChangeListener.ViewChangeEvent event) {
...
extSearch.setSuggestionGenerator(this::find);
}
...
private List<String> find(String search, int cap) {
log.info("find(): {}", search);
return ImmutableList.of("Ole", "Dole", "Doffen");
}
...
}
Never stops in the find-method in the debugger, and the log statemet doesn’t get invoked either. What am I doing wrong?