org.apache.myfaces.custom.ppr
Class PPRPhaseListener

java.lang.Object
  extended by org.apache.myfaces.custom.ppr.PPRPhaseListener
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, javax.faces.event.PhaseListener

public class PPRPhaseListener
extends java.lang.Object
implements javax.faces.event.PhaseListener

Before RenderResponse PhaseListener for processing Ajax requests from PPRPanelGroup. It also participates in handling transient components in PPR Requests

Author:
Ernst Fastl
See Also:
Serialized Form

Constructor Summary
PPRPhaseListener()
           
 
Method Summary
static void addTriggeredComponent(javax.faces.context.FacesContext fc, java.lang.String triggeredComponentClientId)
          API method for adding triggeredComponents programmatically.
 void afterPhase(javax.faces.event.PhaseEvent phaseEvent)
           
 void beforePhase(javax.faces.event.PhaseEvent event)
          Determines wether the currently processed request is a PPR request (by searching for PPR_PARAMETER in the request parameter map) or an ordinary HTTP request.
 javax.faces.event.PhaseId getPhaseId()
           
static boolean isPartialRequest(javax.faces.context.FacesContext context)
          Checks if the currently processed Request is an AJAX request from a PPRPanelGroup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PPRPhaseListener

public PPRPhaseListener()
Method Detail

afterPhase

public void afterPhase(javax.faces.event.PhaseEvent phaseEvent)
Specified by:
afterPhase in interface javax.faces.event.PhaseListener

beforePhase

public void beforePhase(javax.faces.event.PhaseEvent event)
Determines wether the currently processed request is a PPR request (by searching for PPR_PARAMETER in the request parameter map) or an ordinary HTTP request. If the request is a PPR request the triggered components are encoded. Otherwise transient components which have previously been marked not transient by the PPRPanelGroupRenderer are set to transient again

Specified by:
beforePhase in interface javax.faces.event.PhaseListener

isPartialRequest

public static boolean isPartialRequest(javax.faces.context.FacesContext context)
Checks if the currently processed Request is an AJAX request from a PPRPanelGroup

Parameters:
context - the current FacesContext
Returns:
true if a PPR request is being processed , false otherwise

addTriggeredComponent

public static void addTriggeredComponent(javax.faces.context.FacesContext fc,
                                         java.lang.String triggeredComponentClientId)
API method for adding triggeredComponents programmatically.

Parameters:
fc - the current FacesContext
triggeredComponentClientId - client ID of the component which is to be updated in case of a PPR Response

getPhaseId

public javax.faces.event.PhaseId getPhaseId()
Specified by:
getPhaseId in interface javax.faces.event.PhaseListener


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.