Hello guys,
I have a model class that has a observable list property. When I generate an item view model for this model class it binds my list to a property of type Property
So I can't bind this property e.g. to a DataGrid.
Is there a way to bind this so that the observable list is not wrapped in a property? I could not find anything in the provided guide or in the examples. Can anyone give me a hint?
class Demo(val list: ObservableList<String> = observableArrayList<String>())
class DemoModel : ItemViewModel<Demo>() {
val list = bind(Demo::list)
}
Thanks in advance and kind regards
You should be able to cast the bind expression to a SimpleListProperty:
val list: SimpleListProperty<String> = bind(Demo::list)
Thanks for your quick and helpfull answer. Worked like a charm :)
Most helpful comment
You should be able to cast the bind expression to a
SimpleListProperty: