chickenfresh
08/25/2018, 9:51 AMsealed class itemViewInstance {
data class item1(val item1: item1Model): itemViewInstance()
data class item2(val item2: item2Model): itemViewInstance()
}
I have this model class
. array:
val itemlist = FXCollections.observableArrayList<ItemViewInstance>()
and
private val ItemListView = listview(itemlist) {
selectionModel.selectedItemProperty().addListener { _, _, new ->
if (new != null) {
// There I wanna get Item id somehow, which exists in both models (Item1Model and Item2Model)
}
}
is there any way I could get itemid on selection from the list?