pim
07/22/2017, 5:08 PMcellFactory
but the cellFormat
appears to be setting it to a new onepim
07/22/2017, 5:09 PMedvin
07/22/2017, 5:09 PMupdateItem
call for the cell is called. So you can either bind there, using cleanBind
or you can use a cellFragment
if you have lots of logic in the cell code.edvin
07/22/2017, 5:09 PMpim
07/22/2017, 5:09 PMedvin
07/22/2017, 5:11 PMitemProperty
which will be null at creation time. To deal with that, wrap an ItemViewModel around the itemProperty
and bind towards the view model properties. That's really clean, but you need to understand it properly.edvin
07/22/2017, 5:12 PMcellFragment
route but fail to realize that you don't have any data when the Fragment is created. Once you master it, it's really convenient. That being said, if you don't have lots of logic, just bind in cellFormat
.pim
07/22/2017, 5:12 PMpim
07/22/2017, 5:12 PMFragment
before, I'll see if it works now 😉nimakro
07/22/2017, 5:16 PMedvin
07/22/2017, 5:16 PMcleanBind
, which unbinds before it rebinds, basically.pim
07/22/2017, 5:17 PMpim
07/22/2017, 5:18 PMedvin
07/22/2017, 5:18 PMtextProperty().cleanBind(nameable.nameProperty)
pim
07/22/2017, 5:19 PMpim
07/22/2017, 5:20 PMedvin
07/22/2017, 5:20 PMedvin
07/22/2017, 5:20 PMedvin
07/22/2017, 5:22 PMpim
07/22/2017, 5:22 PMitem.nameProperty.value += " 123"
nimakro
07/22/2017, 5:28 PMFilteredList
that it make a difference if I do
private val testList = listOf("test1", "test2", "test3", "blub1", "blub2").observable()
private val testList = FXCollections.observableArrayList("test1", "test2", "test3", "blub1", "blub2")
the first one will throw an UnsupportedOperationException
if you call setAll(...)
since it is using ObservableListWrapper
which is not implementing the setAll
function 😀🙈pim
07/22/2017, 5:59 PMTreeCell.updateItem
appears to be called with a null
item and empty=true
, while in fact it is not -> this causes a RTE because I bound the textProperty
and the method is setting text
to null.nimakro
07/22/2017, 6:32 PMtextProperty().unbind()
it works.
@edvin Should we add textProperty().unbind()
and graphicProperty().unbind()
to the cellFormatter?nimakro
07/22/2017, 6:33 PMnimakro
07/22/2017, 6:36 PMTreeView
from the tornadoFx guide, and I added a textfield
and a button
if you select a person you can change the name and with save the name will be committed and therefor visible in the treeview
. I implemented the cellfactory my self since the default implementation (cellformatter
) is not unbinding the textProperty
when set to null like you pointed out before.nimakro
07/22/2017, 6:37 PMpim
07/22/2017, 6:59 PMedvin
07/22/2017, 7:17 PMedvin
07/22/2017, 7:19 PM