You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 28, 2024. It is now read-only.
As a beginner with Tornadofx and Kotlin I am learning with the nice examples from Edvin Syse.
Now I tried the Scopes example(Share view state using a custom scope in a TornadoFX Master/Detail app) and get the the error message "java.lang.ClassCastException: tornadofx.Scope cannot be cast to ...MyScope"
I am using Intelij IDEA/Gradle 5.3 /Kotlin 1.4.32/TornadoFx 1.7.14/JRE 1.8
Is it a version issue or do I miss something?
`class CustomerModel: ItemViewModel(){
val custName = bind {item?.custNameProperty }
val country = bind {item?.countryProperty }
}
class CustScope :Scope(){
val model= CustomerModel()
val customers = FXCollections.observableArrayList(Customer("a","Frankreich"),
Customer("b","Italien"))
}`
class CustEdit : View("My View") {
override val scope = super.scope as CustScope
val itemsGlobalObject = Locale.getISOCountries().map { Locale("", it) }.observable()
val itemsGlobal = itemsGlobalObject.mapEach { displayCountry }.sorted()
override val root = form {
prefWidth=300.0
hboxConstraints { hGrow =Priority.ALWAYS }
fieldset{
field("Kunde"){
// textfield(model.custName)
textfield(scope.model.custName)
}
field("Land"){
combobox(scope.model.country, itemsGlobal) {
prefWidth = 125.0
makeAutocompletable()
}
}
}
The text was updated successfully, but these errors were encountered:
As a beginner with Tornadofx and Kotlin I am learning with the nice examples from Edvin Syse.
Now I tried the Scopes example(Share view state using a custom scope in a TornadoFX Master/Detail app) and get the the error message "java.lang.ClassCastException: tornadofx.Scope cannot be cast to ...MyScope"
I am using Intelij IDEA/Gradle 5.3 /Kotlin 1.4.32/TornadoFx 1.7.14/JRE 1.8
Is it a version issue or do I miss something?
`class CustomerModel: ItemViewModel(){
}
class CustScope :Scope(){
val model= CustomerModel()
val customers = FXCollections.observableArrayList(Customer("a","Frankreich"),
Customer("b","Italien"))
}`
class CustEdit : View("My View") {
The text was updated successfully, but these errors were encountered: