edvin
10/22/2016, 1:10 PMListCellFragment
is contained in a ListCell, and a ListCell is reused to display different items as you scroll through your list. For that reason, the itemProperty
and corresponding "getter" in item
is changed as the fragment is reused to display different items as well. When you initialize it, there is no item bound to it at all. That's the reason the item value is null in the constructor. For this use case I think it's much easier to use cellCache
which gives you the item right away. To use cellCache
you must make sure that you have a valid equals/hashCode
impl in the Word
class.