[Kotlin UI DSL] textfield binding not working Follow
Answered
Hi there,
I am currently implementing a SettingsEditor for a run configuration of one of my plugins. For this I want to use the Kotlin UI DSL.
The problem I have is that the text field binding seems to not work; the value entered is not applied. Even when debugging I see no change in the bound property.
My prototype code in the SettingsEditor looks like the following:
private var vamosPath = ""
override fun createEditor(): JComponent {
return panel {
row {
textField(::vamosPath)
}
}
}
Is there anything obvious that I overlooked?
Thanks in advance,
Marco
Please sign in to leave a comment.
Please show the full code.
Here is the VamosSettingsEditor code:
And this is the corresponding options type (referenced above via config.options):
Let me know, if you need anything else for diagnosing the problem.
Any update? Or a hint/link to other documentation/support?
Sorry for delay.
Some additional code is required in this case.
Please add
private lateinit var panel: DialogPanel
and store panel {...} result from createEditor().
Then, in resetEditorFrom(), please add as last line
panel.reset()
and in applyEditorTo() as first line
panel.apply()
Reference: https://plugins.jetbrains.com/docs/intellij/kotlin-ui-dsl.html#dialogs