public void processPartial(PhaseId phaseId) {
// If processing a partial request during the "Apply Request Values" phase of the JSF lifecycle, then register
// a callback that will save-off the values of the components that are visited in the tree-walk.
if (phaseId == PhaseId.APPLY_REQUEST_VALUES) {
VisitContextFactory visitContextFactory = (VisitContextFactory) FactoryFinder.getFactory(
FactoryFinder.VISIT_CONTEXT_FACTORY);
Collection<String> renderIds = wrappedPartialViewContext.getExecuteIds();
EnumSet<VisitHint> visitHints = EnumSet.of(VisitHint.EXECUTE_LIFECYCLE);
VisitContext visitContext = visitContextFactory.getVisitContext(facesContext, renderIds, visitHints);
VisitCallback visitCallback = new VisitCallbackApplyRequestValuesImpl();
facesContext.getViewRoot().visitTree(visitContext, visitCallback);
}
// Otherwise, if processing a partial request during the "Render Response" phase of the JSF lifecycle, then
// register a callback that will remove extraneous FacesMessages for components that are visited in the
// tree-walk.
else if (phaseId == PhaseId.RENDER_RESPONSE) {
VisitContextFactory visitContextFactory = (VisitContextFactory) FactoryFinder.getFactory(
FactoryFinder.VISIT_CONTEXT_FACTORY);
Collection<String> renderIds = wrappedPartialViewContext.getExecuteIds();
EnumSet<VisitHint> visitHints = EnumSet.of(VisitHint.EXECUTE_LIFECYCLE);
VisitContext visitContext = visitContextFactory.getVisitContext(facesContext, renderIds, visitHints);
VisitCallback visitCallback = new VisitCallbackRenderResponseImpl();
facesContext.getViewRoot().visitTree(visitContext, visitCallback);
}
// Ask the delegation chain to continue partial request processing.