edvin / tornadofx

Lightweight JavaFX Framework for Kotlin
Apache License 2.0
3.67k stars 269 forks source link

AutoCompleteTextField #601

Open NiranjanShah opened 6 years ago

NiranjanShah commented 6 years ago

Hello, We would like to use the attached AutoCompleteTextField in the form. Kindly guide how to use it

PS: We are new in tornadofx, so possibly we would be using wrong way, kindly guide class AutoCompleteTextField : TextField() { /* The existing autocomplete entries. / /**

When use in the form, it says too many arguments for public constructor init { with(root) { form { fieldset("Edit person") { field("Name") { AutoCompleteTextField { etName = this

                    }
                }

            }
        }
    }
edvin commented 6 years ago

The code you posted is kind of a mess, with code and comments intertwined, but as far as I can see, you have created a class called AutoCompleteTextfield and want to add that to a form. You only have a noargs constructor in your class, so you could have do instantiate it and then do the binding manually:

val tf = AutoCompleteTextField()
add(tf)
tf.textProperty().bind(yourProperty)