Closed aleksandar-stefanovic closed 5 years ago
Can you post some code showing the issue?
I've created a minimal example:
import javafx.beans.property.SimpleBooleanProperty
import tornadofx.*
class MyWizard : Wizard() {
init {
add(WizardStep1::class)
add(WizardStep2::class)
}
}
class WizardStep1 : View("Step 1") {
override val complete = SimpleBooleanProperty(false)
override val root = vbox { }
}
class WizardStep2 : View("Step 2") {
override val root = vbox {}
}
In this example, the "Next" Button appears as not disabled, even though pressing it does nothing. If you change the property to true
, the button works as expected (it goes to the next step when pressed)
Upon further investigation, these are the culprits:
Wizard.kt, (line ~168):
enableWhen(canGoNext.and(hasNext))
Seems good, but then,
open val canGoNext: BooleanExpression = hasNext
Doesn't explain the discrepancy between being disarmed and being disabled, though.
The issue is that the enableWhen
expression should also account for currentPageComplete
. I've committed a fix now :)
Thank you!
Thanks for reporting :))
When using the Wizard, and overriding the
complete
expression, the button is disarmed when the expression isfalse
, but it doesn't appear as disabled.