Package javax.faces.event

Examples of javax.faces.event.PhaseEvent


                    beforePhaseSuccess = new boolean[listenerCount];
                    Arrays.fill(beforePhaseSuccess, true);
                }
            }
           
            PhaseEvent event = createEvent(context, phaseId);

            // only invoke the listener if we are in beforePhase
            // or if the related before PhaseListener finished without an Exception
            if (listener != null && (beforePhase || beforePhaseSuccess[0]))
            {
View Full Code Here


            {
                id = LifecycleFactory.DEFAULT_LIFECYCLE;
            }
            _lifecycle = factory.getLifecycle(id);
        }
        return new PhaseEvent(context, phaseId, _lifecycle);
    }
View Full Code Here

    for (int i = 0; i < phaseListeners.length; i++) {
      PhaseListener phaseListener = phaseListeners[i];
      if (isListenerForThisPhase(phaseListener, phaseId)) {
        try {
          phaseListener.beforePhase(new PhaseEvent(facesContext, phaseId, lifecycle));
          beforePhaseSuccess[i] = true;
        } catch (Exception e) {
          beforePhaseSuccess[i] = false; // redundant - for clarity
          LOG.error("Exception in PhaseListener " + phaseId.toString() + " beforePhase.", e);
          return;
View Full Code Here

    for (int i = phaseListeners.length - 1; i >= 0; i--)  {
      PhaseListener phaseListener = phaseListeners[i];
      if (isListenerForThisPhase(phaseListener, phaseId)
          && beforePhaseSuccess[i]) {
        try {
          phaseListener.afterPhase(new PhaseEvent(facesContext, phaseId, lifecycle));
        } catch (Exception e) {
          LOG.error("Exception in PhaseListener " + phaseId.toString() + " afterPhase", e);
        }
      }
    }
View Full Code Here

        boolean skipPhase = false;

        if (listener != null
                || (_phaseListeners != null && !_phaseListeners.isEmpty()))
        {
            PhaseEvent event = createEvent(context, phaseId);

            if (listener != null)
            {
                listener.invoke(context.getELContext(), new Object[]
                { event });
View Full Code Here

            {
                id = LifecycleFactory.DEFAULT_LIFECYCLE;
            }
            _lifecycle = factory.getLifecycle(id);
        }
        return new PhaseEvent(context, phaseId, _lifecycle);
    }
View Full Code Here

      throws IOException {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    if (null != facesContext) {
      Lifecycle facesLifecycle = getFacesLifecycle();
      PhaseListener[] phaseListeners = facesLifecycle.getPhaseListeners();
      PhaseEvent restoreViewEvent = new PhaseEvent(facesContext,
          PhaseId.RESTORE_VIEW, this);
      processPhaseListeners(phaseListeners, restoreViewEvent, true);
      // Fix for a http://jira.jboss.org/jira/browse/RF-1056
      if (facesContext.getResponseComplete()) {
        return;
      }
      // fix for a http://jira.jboss.com/jira/browse/RF-1064 .
      // viewRoot can be created outside.
      UIViewRoot savedViewRoot = facesContext.getViewRoot();
      try {
        // create "dummy" viewRoot, to avoid problems in phase listeners.
        UIViewRoot root = new UIViewRoot();
        String key = resource.getKey();
        if (null != key && !key.startsWith("/")) {
          key = "/" + key;
        }
        root.setViewId(key);
        root.setLocale(Locale.getDefault());
        root.setRenderKitId(RenderKitFactory.HTML_BASIC_RENDER_KIT);
        facesContext.setViewRoot(root);
        // Invoke after restore view phase listeners
        processPhaseListeners(phaseListeners, restoreViewEvent, false);
        // Fix for a http://jira.jboss.org/jira/browse/RF-1056
        if (!facesContext.getResponseComplete()) {
          // Invoke before render view phase listeners
              PhaseEvent renderViewEvent = new PhaseEvent(facesContext,
              PhaseId.RENDER_RESPONSE, this);
          processPhaseListeners(phaseListeners, renderViewEvent, true);
          sendResource(resourceContext, resource);
          processPhaseListeners(phaseListeners, renderViewEvent, false);
        }
View Full Code Here

        // get the UIViewRoot (note that it must not be null at this point)
        UIViewRoot root = facesContext.getViewRoot();
        MethodExpression afterPhaseExpression = root.getAfterPhaseListener();
        if (afterPhaseExpression != null)
        {
            PhaseEvent event = new PhaseEvent(facesContext, getPhase(), _getLifecycle(facesContext));
            try
            {
                afterPhaseExpression.invoke(facesContext.getELContext(), new Object[] { event });
            }
            catch (Throwable t)
View Full Code Here

        // get the UIViewRoot (note that it must not be null at this point)
        UIViewRoot root = facesContext.getViewRoot();
        MethodExpression afterPhaseExpression = root.getAfterPhaseListener();
        if (afterPhaseExpression != null)
        {
            PhaseEvent event = new PhaseEvent(facesContext, getPhase(), _getLifecycle(facesContext));
            try
            {
                afterPhaseExpression.invoke(facesContext.getELContext(), new Object[] { event });
            }
            catch (Throwable t)
View Full Code Here

        // get the UIViewRoot (note that it must not be null at this point)
        UIViewRoot root = facesContext.getViewRoot();
        MethodExpression afterPhaseExpression = root.getAfterPhaseListener();
        if (afterPhaseExpression != null)
        {
            PhaseEvent event = new PhaseEvent(facesContext, getPhase(), _getLifecycle(facesContext));
            try
            {
                afterPhaseExpression.invoke(facesContext.getELContext(), new Object[] { event });
            }
            catch (Throwable t)
View Full Code Here

TOP

Related Classes of javax.faces.event.PhaseEvent

Copyright © 2018 www.massapicom. 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.