Vinicius Carvalho
05/05/2020, 1:28 AMcolumn("Status", EmulatorDownload::status).cellFormat {
if (it != EmulatorDownloadStatus.DOWNLOADED) {
val button = button("download")
button.action {
println("Current item is ${tableRow.item.version}")
tableRow.item.status = EmulatorDownloadStatus.DOWNLOADING
}
graphic = button
} else {
graphic = text(it.toString()) { }
}
}
Now, that of course does not work 😛 I get that EmulatorDownload is not an ViewModel, however how does ViewModel and controllers are supposed to interact? All examples I can find always use ViewModel on a context of having two views sharing state with each other, and the changes are always from View. -> Model (for instance a property update that triggers a commit on the view model)