0

I'm trying to set up an AutoCompleteTextField. I'm using Callback> versionCollection.

Here is my code :

Callback<AutoCompletionBinding.ISuggestionRequest,Collection<T>> versionCollection = null;
for (Object name : this.fixVersionModel.getFixVersions().keySet()) {
    versionCollection.add((String) name);
}
TextFields.bindAutoCompletion(this.autoCompleteTextField, versionCollection)

I get a stupid error while my collection isn't initialized. Is there no better solution to make an AutoCompleteTextField? If no, could someone help me with my code ?

Thank you.

Julien
  • 19
  • 1
  • 6

1 Answers1

1

You never initialised your versionCollection there so it's obviously going to throw an NPE

Gnas
  • 698
  • 1
  • 6
  • 14
  • I've solved it by myself. My problem was that I didn't use a classic TextField but an autoCompleteTextField from controlFX. Thank you – Julien Nov 23 '18 at 06:43