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
Only short-circuit a non-faces request to render response if view metadata has no children #762
Comments
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented Sending jsf-ri/src/main/java/com/sun/faces/lifecycle/RestoreViewPhase.java |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
|
Currently, on an non-faces request, the Restore View short-circuits to the
Render Response if the view metadata contains no UIViewParameter children. The
exclusive check in this logic breaks the whole extensibility of the view
metadata feature.
Consider that a component author creates a custom component to be used in the
view metadata. Now, the page author has to add add least one (perhaps arbitrary)
UIViewParameter in the view metadata in order for view metadata to go through
the full JSF lifecycle, and the custom component activated, on an initial
request.
Here is the correct logic for the Restore View phase:
viewRoot = metadata.createMetadataView(facesContext);
// Only skip to render response if there are no child components
UIComponent metadataFacet = viewRoot.getFacet(UIViewRoot.METADATA_FACET_NAME);
if (metadataFacet.getChildCount() == 0) {
facesContext.renderResponse();
}
As a workaround, a component author could decorate the createMetadataView call
and add a artificial UIViewParameter if other children are present (though
setting it up would require a lot of work).
Environment
Operating System: All
Platform: All
Affected Versions
[2.0]
The text was updated successfully, but these errors were encountered: