New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PostAddToViewEvent delivery specification needs clarification #805
Comments
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
|
UIComponent.getChildren() says the following about PostAddToViewEvent delivery:
"After the child component has been added to the view, if the following condition is not met:
FacesContext.isPostback() returns true and FacesContext.getCurrentPhaseId() returns
PhaseId.RESTORE_VIEW
Application.publishEvent(javax.faces.context.FacesContext, java.lang.Class, java.lang.Object) must be
called, passing PostAddToViewEvent.class as the first argument and the newly added component as the
second argument."
However:
1. We do actually deliver PostAddToViewEvents during restore view when partial state saving is
enabled.
2. We don't actually want to deliver PostAddToViewEvents during render response when Facelets
temporarily removes/re-adds existing components from the tree.
3. These requirements are not specified in UIComponent.setParent(), which also discusses
PostAddToViewEvent delivery:
"This method will cause an PostAddToViewEvent to be published and if parent.isInView() returns true an
PostAddToViewEvent will be published as well."
The getChildren()/setParent() documentation should either be consistent, or we should remove the doc
from one of these locations.
Environment
Operating System: All
Platform: Macintosh
Affected Versions
[2.0]
The text was updated successfully, but these errors were encountered: