jchildress
03/06/2017, 1:41 PMron
03/06/2017, 1:41 PMjchildress
03/06/2017, 1:42 PMron
03/06/2017, 1:52 PMron
03/06/2017, 1:52 PMron
03/06/2017, 1:55 PMedvin
03/06/2017, 2:00 PMcarlw
03/06/2017, 2:30 PMron
03/06/2017, 2:52 PMcarlw
03/06/2017, 3:03 PMcarlw
03/06/2017, 3:03 PMnimakro
03/06/2017, 3:31 PMbutton(graphic = FontAwesomeIconView(FontAwesomeIcon.ARROW_RIGHT)) { addClass(ApplicationStyle.diffNavButton) disableProperty().bind(model.hasNextRevision)}
where I want to disable the button if there is no next revision,
my model has a BooleanProperty but when I am calling model.hasNextRevision
I get a Property<Boolean>
on which I can't call .not()
. What em I am missing here?gtnarg
03/06/2017, 3:42 PMBindings.not(model.hasNextRevision)
carlw
03/06/2017, 3:59 PMRuckus
03/06/2017, 3:59 PMcarlw
03/06/2017, 4:00 PMRuckus
03/06/2017, 4:00 PMnimakro
03/06/2017, 4:01 PMclass Diff() {
val isSingleFileProperty = SimpleBooleanProperty()
var isSingleFile : Boolean by isSingleFileProperty
val hasNextRevisionProperty = SimpleBooleanProperty()
var hasNextRevision : Boolean by hasNextRevisionProperty
val hasPrevRevisionProperty = SimpleBooleanProperty()
var hasPrevRevision : Boolean by hasPrevRevisionProperty
val currentRevisionProperty = SimpleIntegerProperty()
var currentRevision : Int by currentRevisionProperty
}
class DiffModel : ItemViewModel<Diff>() {
val isSingleFile = bind { item?.isSingleFileProperty }
val hasNextRevision = bind { item?.hasNextRevisionProperty }
val hasPrevRevision = bind { item?.hasNextRevisionProperty }
val currentRevison = bind { item?.currentRevisionProperty }
}
carlw
03/06/2017, 4:02 PMcarlw
03/06/2017, 4:03 PMedvin
03/06/2017, 4:06 PMBooleanProperty
, you just need to specify the type. Do val hasNextRevision: BooleanProperty = bind { item?.hasNextRevisionProperty }
. Also be aware, you have a typo in the hasPrevRevision
binding, you're binding towards the next revision property there as well 🙂nimakro
03/06/2017, 4:09 PM: BooleanProperty
. And yes I have a copy past error 😉edvin
03/06/2017, 4:09 PMcarlw
03/06/2017, 4:10 PMedvin
03/06/2017, 4:11 PMcarlw
03/06/2017, 4:12 PMedvin
03/06/2017, 4:14 PMbind
versions so that you'll get a BooleanProperty
by default. I'll look into that.edvin
03/06/2017, 5:17 PMcarlw
03/06/2017, 5:42 PMedvin
03/06/2017, 5:50 PM