ComboBox: TestEditor to ListView binding
Werner Lehmann
lehmann at media-interactive.de
Mon Jul 7 07:20:15 UTC 2014
Kirill,
ControlsFX has support for this if a 3rd party lib is ok. With
TextFields.createClearableTextField() you create a search field with an
"eraser" icon to clear the text. And the AutoCompletionBinding applied
to the textfield implements the auto complete dropdown. You only have to
provide a function to return search results for user input.
Werner
On 04.07.2014 23:48, Kirill Kirichenko wrote:
> I'm implementing a searchbox.
> In the textfield of the combobox I'm typing a search string.
> textProperty of the editor has an onChange listener which forms a list
> of strings that contain the text as a substring. Then I set this list of
> strings as a content of the drop down list of the combobox.
> The problem is when I start selecting items in the drop down list the
> editor field gets updated making new substring search and updating the
> list again.
> I want to break this dependency. I don't want to update the text
> property when I select an item in the drop down list OR I want to
> distinguish in the textProperty listener what caused that event - real
> editing the field or setting the field trough binding from the list view.
>
> I hope I could make myself clear.
> K
More information about the openjfx-dev
mailing list