Hey folks. I've had a stack overflow question out for a while, I'm wondering if any of you have answers. The short summary: I have a ViewModel whose underlying domain object has a field of MutableList. I don't seem to be able to bind that such that the list contents change when the item changes, unless I make the underlying domain object an ObservableList, which is not something I want to do in this setting. https://stackoverflow.com/questions/56696408/bind-itemviewmodel-to-domain-class-list
s
Spike Baylor
07/16/2019, 12:30 AM
have you tried FXCollections.observableArrayList<Rulebook>()?
g
geepawhill
07/16/2019, 12:32 AM
Tried how, Spike, I'm not following. If I just make the field an ObservableList in the first place, it compiles and runs fine, but that means the underlying domain object must be javafx-aware, which isn't viable in this case.
s
Spike Baylor
07/16/2019, 12:34 AM
oh you need Rulebook's list to change when things change on the Model. Yeah if you find an answer i would also like to know. I did a ton of crazy round about things to make it work for me, bastardizing a Controller in the process.
g
geepawhill
07/16/2019, 12:37 AM
I'm starting to think that my vision is just borked, and I don't need the model's list to change magically, what maybe I need is to notice the change and reset the item because the change happened.
p
pike
07/18/2019, 6:56 AM
Sorry I started a new thread on this and didn't read as closely as I should.
Yes, you need to notice the change, which is what the observablelist or simplelistproperty do.