It's not possible to dynamically remove component from the tree completely. Let me describe the problem. The method disconnectFromView of the class UIComponentBase has a small bug inside. Setting the flag inView to false at the beggining causes an issue in the StateContext - method handleRemove. HandleRemove method does always nothing, because inView is false.
Thank you very much for reporting this. I'm frankly sad that the Faces TCK apparently didn't cover that. It does not seem to be as complete as I expected it to be.
Describe the bug
It's not possible to dynamically remove component from the tree completely. Let me describe the problem. The method
disconnectFromView
of the class UIComponentBase has a small bug inside. Setting the flaginView
to false at the beggining causes an issue in the StateContext - methodhandleRemove
. HandleRemove method does always nothing, because inView is false.As I see, you made some changes in this commit, but it doesn't work https://github.com/eclipse-ee4j/mojarra/commit/6fb231aff3a36288c4851bc69fda561e58bbb909, Now, the
StateContext::handelRemove
does always nothing.So, is it possible to revert changes, or call setInView after the event?
4.0 branch
original
To Reproduce
Steps to reproduce the behavior:
c.getChildren().add(a)
c.getChildren().remove(a)
c.getChildren().add(a)
Desktop (please complete the following information):