-
Bug
-
Resolution: Fixed
-
P3
-
fx2.0
I am evolving an editable ListView we have in the SceneBuilder in order to simplify edition flow. I managed (with quite a lot of difficulties actually) to isolate the problem in a simple testcase. The testcase is attached.
To get a feel of the flow:
1) run the testcase
2) Click on add. This add a "transient" item in edit mode. I call it transient because if the edition is canceled, then the ListView model is put back to its initial state.
3) If you commit or cancel the edition, you will get a stackoverflow.
The stack overflow root cause is in ListView.setOnEditCancel handler. The strange thing is that editCancel is called when commit occurs.
The logic of the handler is to set the items content (thanks to setAll) to what it was before the "transient" item was added.
I also noticed, that, whatever the call to setItems to setAll, the startEdit is called on some ListCell that are not visible. The more you add/remove listCells, the more you get editStart callbacks called. I am suspecting a leak wit listener somewhere.
To get a feel of the flow:
1) run the testcase
2) Click on add. This add a "transient" item in edit mode. I call it transient because if the edition is canceled, then the ListView model is put back to its initial state.
3) If you commit or cancel the edition, you will get a stackoverflow.
The stack overflow root cause is in ListView.setOnEditCancel handler. The strange thing is that editCancel is called when commit occurs.
The logic of the handler is to set the items content (thanks to setAll) to what it was before the "transient" item was added.
I also noticed, that, whatever the call to setItems to setAll, the startEdit is called on some ListCell that are not visible. The more you add/remove listCells, the more you get editStart callbacks called. I am suspecting a leak wit listener somewhere.