ron
03/06/2017, 8:11 PMron
03/06/2017, 8:11 PMron
03/06/2017, 8:12 PMcarlw
03/06/2017, 8:12 PMron
03/06/2017, 8:12 PMcarlw
03/06/2017, 8:26 PMgtnarg
03/06/2017, 9:21 PMedvin
03/06/2017, 9:46 PMgtnarg
03/06/2017, 9:48 PMedvin
03/06/2017, 9:51 PMnimakro
03/07/2017, 11:48 AMjava
class Model() {
// -- Toolbar
val expandLevelProperty = SimpleIntegerProperty()
var expandLevel : Int by expandLevelProperty
}
class ViewModel : ItemViewModel<Model>() {
// Throws the exception!!
val expandLevel : IntegerProperty = bind { item?.expandLevelProperty }
}
when I start my app I get an java.lang.ClassCastException: javafx.beans.property.SimpleObjectProperty cannot be cast to javafx.beans.property.IntegerProperty
.
Is that a bug or em I am doing something wrong again?ron
03/07/2017, 11:57 AMjchildress
03/07/2017, 11:57 AMnimakro
03/07/2017, 12:01 PMmodel.expandLevel.isEaualTo(0)
nimakro
03/07/2017, 12:01 PMron
03/07/2017, 12:05 PMnimakro
03/07/2017, 12:10 PMron
03/07/2017, 12:10 PMedvin
03/07/2017, 3:03 PMedvin
03/07/2017, 3:08 PMedvin
03/07/2017, 3:10 PMbind
, there is nothing in your item
, so the best the ViewModel can do is to create an ObjectProperty
. If you initialize the ViewModel with an item at once, it will work. This would be OK:edvin
03/07/2017, 3:11 PMedvin
03/07/2017, 3:11 PMnimakro
03/07/2017, 3:36 PMedvin
03/07/2017, 3:47 PMnimakro
03/07/2017, 3:49 PMnimakro
03/07/2017, 4:15 PMcarlw
03/07/2017, 4:21 PMron
03/07/2017, 4:21 PM