bjonnh
01/07/2019, 5:17 PMvar journal = bind(forceObjectProperty = true) { citation?.observable(Citation::journal_id) as Property<Int>? }
var journalEntry = bind {
legacyController.journalList?.getElement(journal.value).toProperty()
}
It is used to feed a combobox, but the problem is even before that I can see it when I do:
model.journalEntry.onChange { println("Changed the journal to $it") }
The model is defined as a class CitationModel(var citation: Citation?) : ViewModel() { … }
The model is by default a val model = CitationModel(null)
Once the user loads something, I do a citationView.model.rebind {
citation = newCitation
}
where newCitation is coming from some database query.
I get the right call to rebind, and the object bound is the good one.bjonnh
01/07/2019, 5:22 PMJournal entry post bind ObjectProperty [bean: models.CitationModel@701d8c0f, value: CodeNameEntry(id=, code=, name=)]
where as when it works:
Journal entry post bind ObjectProperty [bean: models.CitationModel@701d8c0f, value: CodeNameEntry(id=1112, code=PD, name=PHYTOMEDICINE)]
when changing the model, it always starts working the second time after the object has been changed from null in the model. However the first time, it depends sometimes it works sometimes it doesn't even with the same source data.bjonnh
01/07/2019, 5:25 PM