binding - Update autoComplete JavaFx? -
i working on javafx project. when add new elements in table of database should update autocomplete ,i did problem showing double context-menu ,we can double autocompletes because call method create autocomplete each adding of new elements.
i call method each adding:
public void pushbills() { arraylist list = new arraylist<>(); bills = new billheaderdao().findall(); (int = 0; < bills.size(); i++) { list.add(bills.get(i).getidclient()); } autocompletionbinding = textfields.bindautocompletion(searchbill, suggestionprovider.create(list)); }
how can resolve problem ?
this trick: instead of: textfields.bindautocompletion(textfield, list);
, try this:
list<string> strings = new arraylist<>();
then create binding between textfield list through:
new autocompletiontextfieldbinding<>(textfield, suggestionprovider.create(strings));
so changes, including removing, list, reflected in autocompletion of textfield; , have dynamic filtering of suggestions, showed in pop-up, when user enter text in textfield;
Comments
Post a Comment