Examples of VisitContextFactory


Examples of javax.faces.component.visit.VisitContextFactory

  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.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.