```listview(blocks) { setCellFactory { val cell...
# tornadofx
l
Copy code
listview(blocks) {
	setCellFactory {
		val cell = ListCell<Block>()
		cell.text = cell.item.toString() //nullref here because cell.item is null
		return@setCellFactory cell
	}
}
how do i get a reference to the item the cell is going to represent so I can set the cell text?
r
I think you're a bit mistaken. You need to override the
updateItem
function of the
ListCell
.
`ListCell`s can theoretically be reused (JavaFX has support for virtual scrolling), so the
ListCell
itself needs to contain logic for what to do when the associated value changes.