I have a object in a 3rd party library (e.g.: `Per...
# tornadofx
s
I have a object in a 3rd party library (e.g.:
Person
) that I am using as the value of an
ItemViewModel
. It has a collection (e.g.:
var hairColors:Set<String>
). How do I bind it to the
ItemViewModel
? If I do
val hairColors = bind(Person::hairColors)
, I get
java.lang.ClassCastException: java.util.LinkedHashSet cannot be cast to javafx.collections.ObservableSet
. I think I need to do something with
bind(forceObjectProperty=true)
and
rebindOnChange
, but I am not sure what.
I wired it up myself with a couple of change listeners.