Package javax.faces.event

Examples of javax.faces.event.PhaseId


    private final void dispatchBehaviorEvent(UIComponent component, AjaxBehavior ajaxBehavior)
    {
        AjaxBehaviorEvent event = new AjaxBehaviorEvent(component, ajaxBehavior);

        PhaseId phaseId = ajaxBehavior.isImmediate() || isComponentImmediate(component) ?
                PhaseId.APPLY_REQUEST_VALUES :
                PhaseId.INVOKE_APPLICATION;

        event.setPhaseId(phaseId);
View Full Code Here


    @Override
    public void doPrePhaseActions(FacesContext facesContext)
    {
        if (!_flashScopeDisabled)
        {
            final PhaseId currentPhaseId = facesContext.getCurrentPhaseId();
       
            if (PhaseId.RESTORE_VIEW.equals(currentPhaseId))
            {
                // restore the redirect value
                // note that the result of this method is used in many places,
View Full Code Here

     * or if setRedirect(true) was called on this request and we are
     * in phase 5 (invoke application).
     */
    private boolean _isLastPhaseInRequest(FacesContext facesContext)
    {
        final PhaseId currentPhaseId = facesContext.getCurrentPhaseId();
       
        boolean lastPhaseNormalRequest = PhaseId.RENDER_RESPONSE.equals(currentPhaseId);
        boolean lastPhaseIfRedirect = PhaseId.INVOKE_APPLICATION.equals(currentPhaseId)
                && _isRedirectTrueOnThisRequest(facesContext);
       
View Full Code Here

        this.beforeAnyPhaseEvent.fire(phaseEvent);

        //fire to ds-phase-listeners
        for (PhaseListener phaseListener : this.phaseListeners)
        {
            PhaseId targetPhase = phaseListener.getPhaseId();

            if (targetPhase == PhaseId.ANY_PHASE || targetPhase == phaseEvent.getPhaseId())
            {
                phaseListener.beforePhase(phaseEvent);
            }
View Full Code Here

        ListIterator<PhaseListener> phaseListenerIterator = this.phaseListeners.listIterator(phaseListeners.size());

        while (phaseListenerIterator.hasPrevious())
        {
            PhaseListener phaseListener = phaseListenerIterator.previous();
            PhaseId targetPhase = phaseListener.getPhaseId();

            if (targetPhase == PhaseId.ANY_PHASE || targetPhase == phaseEvent.getPhaseId())
            {
                phaseListener.afterPhase(phaseEvent);
            }
View Full Code Here

      listenerExpression.invoke(context.getELContext(),
          new Object[] { event });
    }
    if (null != this.phaseListeners) {
      for (PhaseListener listener : phaseListeners) {
        PhaseId phaseId = listener.getPhaseId();
        if (phaseId == phase || phaseId == PhaseId.ANY_PHASE) {
          if (null == event) {
            event = createPhaseEvent(context, phase);
          }
          if (before) {
View Full Code Here

            }
        }
    }
   
    public void doPrePhaseActions(FacesContext context) {
        PhaseId currentPhase = context.getCurrentPhaseId();
        Map<Object, Object> contextMap = context.getAttributes();
        contextMap.put(CONSTANTS.SavedResponseCompleteFlagValue,
                context.getResponseComplete());

        if (currentPhase.equals(PhaseId.RESTORE_VIEW)) {
            Cookie cookie = null;

            if (null != (cookie = getCookie(context.getExternalContext()))) {
                getCurrentFlashManager(context, contextMap, cookie);
            }
View Full Code Here

                    (Boolean) context.getAttributes().get(ACT_AS_DO_LAST_PHASE_ACTIONS);
            doLastPhaseActions(context, outgoingResponseIsRedirect);
            return;
        }
       
        PhaseId currentPhase = context.getCurrentPhaseId();
        Map<Object, Object> contextMap = context.getAttributes();
        boolean
                responseCompleteJustSetTrue = responseCompleteWasJustSetTrue(context, contextMap),
                lastPhaseForThisRequest = responseCompleteJustSetTrue ||
                                          currentPhase == PhaseId.RENDER_RESPONSE;
View Full Code Here

    }

    private Map<String, Object> loggingGetPhaseMapForWriting(boolean loggingEnabled) {
        FacesContext context = FacesContext.getCurrentInstance();
        Map<String, Object> result = null;
        PhaseId currentPhase = context.getCurrentPhaseId();
        Map<Object, Object> contextMap = context.getAttributes();

        PreviousNextFlashInfoManager flashManager;
        if (null != (flashManager = getCurrentFlashManager(contextMap, true))) {
            FlashInfo flashInfo;
            boolean isDebugLog = loggingEnabled && LOGGER.isLoggable(Level.FINEST);

            if (currentPhase.getOrdinal() < PhaseId.RENDER_RESPONSE.getOrdinal()) {
                flashInfo = flashManager.getPreviousRequestFlashInfo();
                if (isDebugLog) {
                    LOGGER.log(Level.FINEST, "{0}previous[{1}]",
                            new Object[]{getLogPrefix(context),
                                flashInfo.getSequenceNumber()});
View Full Code Here

            if (_phaseListeners != null && !_phaseListeners.isEmpty())
            {
                for (PhaseListener phaseListener : _phaseListeners)
                {
                    PhaseId listenerPhaseId = phaseListener.getPhaseId();
                    if (phaseId.equals(listenerPhaseId)
                            || PhaseId.ANY_PHASE.equals(listenerPhaseId))
                    {
                        if (beforePhase)
                        {
View Full Code Here

TOP

Related Classes of javax.faces.event.PhaseId

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.