I would expect this AutoCompleteTextField to work but it doesn't:
Form hi = new Form("Auto Complete", new BoxLayout(BoxLayout.Y_AXIS));
final DefaultListModel<String> options = new DefaultListModel<>();
AutoCompleteTextField ac = new AutoCompleteTextField(options) {
@Override
protected boolean filter(String text) {
if(text.length() == 0) {
return false;
}
java.util.List<Map<String, Object>> l = searchLocations(text);
if(l == null || l.size() == 0) {
return false;
}
options.removeAll();
for(Map<String, Object> o : l) {
options.addItem((String)o.get("place_name"));
}
return true;
}
};
ac.setMinimumElementsShownInPopup(5);
hi.add(ac);
I think we need to rewrite the component to provide an option that doesn't use a list (e.g. for more customizability) and to provide better dynamic fill.
With the webservice defined here:
I would expect this
AutoCompleteTextField
to work but it doesn't:I think we need to rewrite the component to provide an option that doesn't use a list (e.g. for more customizability) and to provide better dynamic fill.