javax.faces.context
Class PartialViewContext

java.lang.Object
  extended by javax.faces.context.PartialViewContext

public abstract class PartialViewContext
extends Object

PartialViewContext contains methods and properties that pertain to partial request processing and partial response rendering on a view.

The PartialViewContext instance is used to determine if the current request indicates the requirement to perform partial processing and/or partial rendering. Partial processing is the processing of selected components through the execute portion of the request processing lifecycle. Partial rendering is the rendering of specified components in the Render Response Phase of the request processing lifecycle.


Field Summary
static String ALL_PARTIAL_PHASE_CLIENT_IDS
          

The value that when used with PARTIAL_EXECUTE_PARAM_NAME or PARTIAL_RENDER_PARAM_NAME indicates these phases must be skipped.

static String NO_PARTIAL_PHASE_CLIENT_IDS
          

The value that when used with PARTIAL_EXECUTE_PARAM_NAME or PARTIAL_RENDER_PARAM_NAME indicates these phases must be skipped.

static String PARTIAL_EXECUTE_PARAM_NAME
          

The request parameter name whose request parameter value is a Collection of client identifiers identifying the components that must be processed during the Apply Request Values, Process Validations, and Update Model Values phases of the request processing lifecycle.

static String PARTIAL_RENDER_PARAM_NAME
          

The request parameter name whose request parameter value is a Collection of client identifiers identifying the components that must be processed during the Render Response phase of the request processing lifecycle.

 
Constructor Summary
PartialViewContext()
           
 
Method Summary
abstract  Collection<String> getExecuteIds()
          

Return a Collection of client identifiers from the current request with the request parameter name PARTIAL_EXECUTE_PARAM_NAME.

abstract  PartialResponseWriter getPartialResponseWriter()
          

Return the ResponseWriter to which components should direct their output for partial view rendering.

abstract  Collection<String> getRenderIds()
          

Return a Collection of client identifiers from the current request with the request parameter name PARTIAL_RENDER_PARAM_NAME.

abstract  boolean isAjaxRequest()
          

Return true if the request parameter javax.faces.partial.ajax is present in the current request.

abstract  boolean isExecuteAll()
          

Return true if isAjaxRequest() returns true and PARTIAL_EXECUTE_PARAM_NAME is present in the current request with the value ALL_PARTIAL_PHASE_CLIENT_IDS.

abstract  boolean isPartialRequest()
          

Return true if the request parameter javax.faces.partial or javax.faces.partial.ajax is present in the current request.

abstract  boolean isRenderAll()
          

Return true if isAjaxRequest() returns true and PARTIAL_RENDER_PARAM_NAME is present in the current request with the value ALL_PARTIAL_PHASE_CLIENT_IDS.

abstract  void processPartial(FacesContext context, PhaseId phaseId)
          

Perform lifecycle processing on components during the indicated phaseId.

abstract  void release()
          Release any resources associated with this PartialViewContext instance.
abstract  void setRenderAll(boolean renderAll)
          

Indicate the entire view must be rendered if renderAll is true.

 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARTIAL_RENDER_PARAM_NAME

public static final String PARTIAL_RENDER_PARAM_NAME

The request parameter name whose request parameter value is a Collection of client identifiers identifying the components that must be processed during the Render Response phase of the request processing lifecycle.

Since:
2.0
See Also:
Constant Field Values

PARTIAL_EXECUTE_PARAM_NAME

public static final String PARTIAL_EXECUTE_PARAM_NAME

The request parameter name whose request parameter value is a Collection of client identifiers identifying the components that must be processed during the Apply Request Values, Process Validations, and Update Model Values phases of the request processing lifecycle.

Since:
2.0
See Also:
Constant Field Values

NO_PARTIAL_PHASE_CLIENT_IDS

public static final String NO_PARTIAL_PHASE_CLIENT_IDS

The value that when used with PARTIAL_EXECUTE_PARAM_NAME or PARTIAL_RENDER_PARAM_NAME indicates these phases must be skipped.

Since:
2.0
See Also:
Constant Field Values

ALL_PARTIAL_PHASE_CLIENT_IDS

public static final String ALL_PARTIAL_PHASE_CLIENT_IDS

The value that when used with PARTIAL_EXECUTE_PARAM_NAME or PARTIAL_RENDER_PARAM_NAME indicates these phases must be skipped.

Since:
2.0
See Also:
Constant Field Values
Constructor Detail

PartialViewContext

public PartialViewContext()
Method Detail

getExecuteIds

public abstract Collection<String> getExecuteIds()

Return a Collection of client identifiers from the current request with the request parameter name PARTIAL_EXECUTE_PARAM_NAME. If the value of the request parameter is NO_PARTIAL_PHASE_CLIENT_IDS, or there is no such request parameter, return an empty Collection. These client identifiers are used to identify components that will be processed during the execute phase of the request processing lifecycle. The returned Collection is mutable.

Throws:
IllegalStateException - if this method is called after this instance has been released
Since:
2.0

getRenderIds

public abstract Collection<String> getRenderIds()

Return a Collection of client identifiers from the current request with the request parameter name PARTIAL_RENDER_PARAM_NAME. If the value of the request parameter is NO_PARTIAL_PHASE_CLIENT_IDS, or there is no such request parameter, return an empty Collection. These client identifiers are used to identify components that will be processed during the render phase of the request processing lifecycle. The returned Collection is mutable.

Throws:
IllegalStateException - if this method is called after this instance has been released
Since:
2.0

getPartialResponseWriter

public abstract PartialResponseWriter getPartialResponseWriter()

Return the ResponseWriter to which components should direct their output for partial view rendering. Within a given response, components can use either the ResponseStream or the ResponseWriter, but not both.

Throws:
IllegalStateException - if this method is called after this instance has been released
Since:
2.0

isAjaxRequest

public abstract boolean isAjaxRequest()

Return true if the request parameter javax.faces.partial.ajax is present in the current request. Otherwise, return false.

Throws:
IllegalStateException - if this method is called after this instance has been released
Since:
2.0

isPartialRequest

public abstract boolean isPartialRequest()

Return true if the request parameter javax.faces.partial or javax.faces.partial.ajax is present in the current request. Otherwise, return false.

Throws:
IllegalStateException - if this method is called after this instance has been released
Since:
2.0

isExecuteAll

public abstract boolean isExecuteAll()

Return true if isAjaxRequest() returns true and PARTIAL_EXECUTE_PARAM_NAME is present in the current request with the value ALL_PARTIAL_PHASE_CLIENT_IDS.

Otherwise, return false.

Throws:
IllegalStateException - if this method is called after this instance has been released
Since:
2.0

isRenderAll

public abstract boolean isRenderAll()

Return true if isAjaxRequest() returns true and PARTIAL_RENDER_PARAM_NAME is present in the current request with the value ALL_PARTIAL_PHASE_CLIENT_IDS.

Otherwise, return false.

Throws:
IllegalStateException - if this method is called after this instance has been released
Since:
2.0

setRenderAll

public abstract void setRenderAll(boolean renderAll)

Indicate the entire view must be rendered if renderAll is true.

Parameters:
renderAll - the value true indicates the entire view must be rendered.
Throws:
IllegalStateException - if this method is called after this instance has been released
Since:
2.0

release

public abstract void release()

Release any resources associated with this PartialViewContext instance.

Throws:
IllegalStateException - if this method is called after this instance has been released

processPartial

public abstract void processPartial(FacesContext context,
                                    PhaseId phaseId)

Perform lifecycle processing on components during the indicated phaseId. Only those components with identifiers existing in the Collection returned from getExecuteIds() and getRenderIds() will be processed.

Parameters:
context - the current FacesContext instance.
phaseId - the PhaseId that indicates the lifecycle phase the components will be processed in.


Copyright © 2002-2008 Sun Microsystems, Inc. All Rights Reserved.