3

When I increase the font size of an Autocomplete TextField using CSS or Java, the Autocompleted suggestion list does not increase in height to fit the enlarged text.

screenshot

In addition, the popup doesn't appear below the TextField. It works fine as long as I don't increase the font size.

I tried using padding and adjusting the margins, but it didn't work. How can I increase the height of the Autocomplete suggestion list?

Stevoisiak
  • 23,794
  • 27
  • 122
  • 225
user2312688
  • 521
  • 7
  • 17
  • What did you put in the stylesheet to increase the font size? – Stevoisiak Apr 10 '17 at 03:34
  • Hello, sorry that I cannot help your issue, but could you be so kind and explain how you achieved the font change at very least? Found two places on the internet with people asking about how to alter the autocompletition window in any way at all but without an answer. Huge thanks in advance :) – DragonGamer Mar 21 '18 at 23:29

1 Answers1

3

The Autocomplete from ControlFX is a listview binding with a TextProperty ,so if you need to increase the higth of autocomplete you should set the number of visible rows in ListView by this way :

TextFields.bindAutoCompletion(SearchSuppEmp, employeesProvider).setVisibleRowCount(10);

SearchSuppEmp :is a textfield

employeesProvider:is a Set of elements

This is a sample of code (searching about employees in company) :

Set<String> getAllEmployees() {
    Set<String> autoCompletions = new HashSet<>();
    new EMPDao().FindAll().forEach(employee -> {
        autoCompletions.add(employee.getNFile());
        autoCompletions.add(employee.getLName() + "  " + employee.getFName());
    });
    return autoCompletions;
}

void initEmployeesSuggestions() {
    employeesProvider = SuggestionProvider.create(getAllEmployees());
    TextFields.bindAutoCompletion(SearchSuppEmp, employeesProvider).setVisibleRowCount(10);
}
Miss Chanandler Bong
  • 4,081
  • 10
  • 26
  • 36