public UIViewParameter getUIViewParameter(FacesContext context) {
UIViewParameter result = null;
UIViewRoot root = context.getViewRoot();
// If the view root is the same as when we were constructed...
if (this.viewIdAtTimeOfConstruction.equals(root.getViewId())) {
// get the actual view parameter from the tree...
UIComponent metadataFacet = root.getFacet(UIViewRoot.METADATA_FACET_NAME);
result = (UIViewParameter) metadataFacet.getChildren().get(indexInParent);
} else {
// otherwise, use the saved one
result = (UIViewParameter) this.saver.restore(context);
}
return result;
}
Return the
UIViewParameter to which this instance refers.
If the current viewId is the same as the viewId passed to our
constructor, use the index passed to the constructor to find
the actual UIViewParameter instance and return
it. Otherwise, call StateHolder#restoreState on the
saved state and return the result.
|