Top Description Fields Constructors Methods
javax.faces.context

public abstract Class PartialViewContext

extends Object
Class Inheritance
Known Direct Subclasses
javax.faces.context.PartialViewContextWrapper
Imports
java.util.Collection, .List, javax.faces.application.ResourceHandler, .StateManager, javax.faces.component.UIComponent, .UINamingContainer, .UIViewRoot, javax.faces.event.PhaseId

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

Modifier and TypeField and Description
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.

public static final String
PARTIAL_EVENT_PARAM_NAME

The request parameter name whose request parameter value identifies the type of partial event.

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.

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.

public static final String
RESET_VALUES_PARAM_NAME

If the request parameter named by the value of this constant has a parameter value of true, the implementation must return true from isResetValues.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract List<String>

Returns:

A mutable List of scripts to be evaluated in client side on complete of ajax request.
getEvalScripts
()

Returns a mutable List of scripts to be evaluated in client side on complete of ajax request.

public abstract Collection<String>

Returns:

the ids for the execute portion of the lifecycle
getExecuteIds
()

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

public abstract PartialResponseWriter

Returns:

the ResponseWriter for output
getPartialResponseWriter
()

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

public abstract Collection<String>

Returns:

the ids for the render portion of the lifecycle
getRenderIds
()

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

public abstract boolean

Returns:

whether or not this is an ajax request
isAjaxRequest
()

Return true if the request header Faces-Request is present with the value partial/ajax.

public abstract boolean

Returns:

whether or not this is an execute all request
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.

public abstract boolean

Returns:

whether or not this request is partial
isPartialRequest
()

Return true isAjaxRequest returns true or if the request header Faces-Request is present with the value partial/process.

public abstract boolean

Returns:

whether or not this is a render all request
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.

public boolean

Returns:

whether or not this is a reset values request
isResetValues
()

Return true if the incoming request has a parameter named by the value of RESET_VALUES_PARAM_NAME and that value is true.

public abstract void
processPartial(PhaseId
the javax.faces.event.PhaseId that indicates the lifecycle phase the components will be processed in.
phaseId
)

Perform lifecycle processing on components during the indicated phaseId.

public abstract void
release()

Release any resources associated with this PartialViewContext instance.

public abstract void
setPartialRequest(boolean
the value true indicates this is a partial request.
isPartialRequest
)

Dynamically indicate that this is a partial request.

public abstract void
setRenderAll(boolean
the value true indicates the entire view must be rendered.
renderAll
)

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

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ALL_PARTIAL_PHASE_CLIENT_IDSback to summary
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
PARTIAL_EVENT_PARAM_NAMEback to summary
public static final String PARTIAL_EVENT_PARAM_NAME

The request parameter name whose request parameter value identifies the type of partial event.

Since
2.3
PARTIAL_EXECUTE_PARAM_NAMEback to summary
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
PARTIAL_RENDER_PARAM_NAMEback to summary
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
RESET_VALUES_PARAM_NAMEback to summary
public static final String RESET_VALUES_PARAM_NAME

If the request parameter named by the value of this constant has a parameter value of true, the implementation must return true from isResetValues.

Since
2.2

Constructor Detail

PartialViewContextback to summary
public PartialViewContext()

Method Detail

getEvalScriptsback to summary
public abstract List<String> getEvalScripts()

Returns a mutable List of scripts to be evaluated in client side on complete of ajax request.

Returns:List<String>

A mutable List of scripts to be evaluated in client side on complete of ajax request.

Exceptions
IllegalStateException:
If this method is called after this instance has been released.
Since
2.3
getExecuteIdsback to summary
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 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.

Returns:Collection<String>

the ids for the execute portion of the lifecycle

Exceptions
IllegalStateException:
if this method is called after this instance has been released
Since
2.0
getPartialResponseWriterback to summary
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.

Returns:PartialResponseWriter

the ResponseWriter for output

Exceptions
IllegalStateException:
if this method is called after this instance has been released
Since
2.0
getRenderIdsback to summary
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 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.

Returns:Collection<String>

the ids for the render portion of the lifecycle

Exceptions
IllegalStateException:
if this method is called after this instance has been released
Since
2.0
isAjaxRequestback to summary
public abstract boolean isAjaxRequest()

Return true if the request header Faces-Request is present with the value partial/ajax. Otherwise, return false.

Returns:boolean

whether or not this is an ajax request

Exceptions
IllegalStateException:
if this method is called after this instance has been released
Since
2.0
isExecuteAllback to summary
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.

Returns:boolean

whether or not this is an execute all request

Exceptions
IllegalStateException:
if this method is called after this instance has been released
Since
2.0
isPartialRequestback to summary
public abstract boolean isPartialRequest()

Return true isAjaxRequest returns true or if the request header Faces-Request is present with the value partial/process. Otherwise, return false.

Returns:boolean

whether or not this request is partial

Exceptions
IllegalStateException:
if this method is called after this instance has been released
Since
2.0
isRenderAllback to summary
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.

Returns:boolean

whether or not this is a render all request

Exceptions
IllegalStateException:
if this method is called after this instance has been released
Since
2.0
isResetValuesback to summary
public boolean isResetValues()

Return true if the incoming request has a parameter named by the value of RESET_VALUES_PARAM_NAME and that value is true. To preserve backward compatibility with custom implementations that may have extended from an earlier version of this class, an implementation is provided that returns false. A compliant implementation must override this method to take the specified action.

Returns:boolean

whether or not this is a reset values request

Since
2.2
processPartialback to summary
public abstract void processPartial(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.

When the indicated phaseId equals PhaseId#RENDER_RESPONSE, then perform the following tasks in sequence:

  1. If isResetValues() returns true, then call UIViewRoot#resetValues(FacesContext, Collection), passing getRenderIds().
  2. If isRenderAll() returns false, then render any component resource of UIViewRoot whose ResourceHandler#getRendererTypeForResourceName(String) does not return null, and whose UIComponent#getChildCount() is zero, and whose ResourceHandler#isResourceRendered(FacesContext, String, String) returns false, in an update element with an identifier of javax.faces.Resource.
  3. Process the components.
  4. Obtain the state by calling StateManager#getViewState and write it out as an update element with an identifier of <VIEW_ROOT_CONTAINER_CLIENT_ID><SEP>javax.faces.ViewState where <VIEW_ROOT_CONTAINER_CLIENT_ID> is the return from UIViewRoot#getContainerClientId(FacesContext) on the view from whence this state originated, and <SEP> is the currently configured UINamingContainer#getSeparatorChar(FacesContext).
  5. If isRenderAll() returns false, then write out each script of getEvalScripts() as an eval element.
Parameters
phaseId:PhaseId

the javax.faces.event.PhaseId that indicates the lifecycle phase the components will be processed in.

releaseback to summary
public abstract void release()

Release any resources associated with this PartialViewContext instance.

Exceptions
IllegalStateException:
if this method is called after this instance has been released
setPartialRequestback to summary
public abstract void setPartialRequest(boolean isPartialRequest)

Dynamically indicate that this is a partial request.

Parameters
isPartialRequest:boolean

the value true indicates this is a partial request.

Exceptions
IllegalStateException:
if this method is called after this instance has been released
Since
2.0
setRenderAllback to summary
public abstract void setRenderAll(boolean renderAll)

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

Parameters
renderAll:boolean

the value true indicates the entire view must be rendered.

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