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 was archived by the owner on Sep 28, 2024. It is now read-only.
I was hoping to get some clarification on a point in the Guide w.r.t. a data drive TreeView. I'm having trouble getting this working, and am wondering what I might be missing.
Here is my ViewModel:
classContactViewModel : ViewModel() {
privateval activeMapProperty = mapProperty(observableMapOf<String, ServiceAnnouncement>())
privateval activeProperty = listProperty(observableListOf<ServiceAnnouncement>())
val active:ObservableList<ServiceAnnouncement> by activeProperty // explicit type due to platform callinit {
AddressBook.ContactAdded+= ::contactAdded
activeProperty.bind(nonNullObjectBinding(activeMapProperty) { observableListOf(values) } )
}
privatefuncontactAdded(sender:Any, contact:ServiceAnnouncement) {
activeMapProperty.putIfAbsent(contact.uid, contact)
}
}
If the child list you return from populate is an ObservableList, any changes to that list will automatically be reflected in the TreeView. The populate function will be called for any new children that appears, and removed items will result in removed TreeItems as well.
As you can see, my ContactViewModel::active property is type ObservableList<ServiceAnnouncement>, which meets the "if the child list you return is an ObservableList" criteria. And I was able to verify through the IntelliJ debugger that when ContactViewModel::contactAdded is called that all of activeMapProperty, activeProperty, and active reflect the update, but nothing happens in my UI.
Any advice would be greatly appreciated!
The text was updated successfully, but these errors were encountered:
Hello TornadoFx community!
I was hoping to get some clarification on a point in the Guide w.r.t. a data drive TreeView. I'm having trouble getting this working, and am wondering what I might be missing.
Here is my ViewModel:
And in my View class:
From the Guide section on Data Driven TreeView:
As you can see, my
ContactViewModel::active
property is typeObservableList<ServiceAnnouncement>
, which meets the "if the child list you return is an ObservableList" criteria. And I was able to verify through the IntelliJ debugger that whenContactViewModel::contactAdded
is called that all ofactiveMapProperty
,activeProperty
, andactive
reflect the update, but nothing happens in my UI.Any advice would be greatly appreciated!
The text was updated successfully, but these errors were encountered: