Class PartialViewContext
- java.lang.Object
-
- javax.faces.context.PartialViewContext
-
- Direct Known Subclasses:
PartialViewContextWrapper
public abstract class PartialViewContext extends java.lang.ObjectPartialViewContext contains methods and properties that pertain to partial request processing and partial response rendering on a view.
The
PartialViewContextinstance is used to determine if the current request indicates the requirement to performpartial processingand/orpartial rendering. Partial processing is the processing of selected components through theexecuteportion of the request processing lifecycle. Partial rendering is the rendering of specified components in theRender Response Phaseof the request processing lifecycle.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringALL_PARTIAL_PHASE_CLIENT_IDSThe value that when used withPARTIAL_EXECUTE_PARAM_NAMEorPARTIAL_RENDER_PARAM_NAMEindicates these phases must be skipped.static java.lang.StringPARTIAL_EXECUTE_PARAM_NAMEThe request parameter name whose request parameter value is aCollectionof 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 java.lang.StringPARTIAL_RENDER_PARAM_NAMEThe request parameter name whose request parameter value is aCollectionof client identifiers identifying the components that must be processed during the Render Response phase of the request processing lifecycle.static java.lang.StringRESET_VALUES_PARAM_NAMEIf the request parameter named by the value of this constant has a parameter value oftrue, the implementation must returntruefromisResetValues().
-
Constructor Summary
Constructors Constructor Description PartialViewContext()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.util.Collection<java.lang.String>getExecuteIds()Return aCollectionof client identifiers from the current request with the request parameter namePARTIAL_EXECUTE_PARAM_NAME.abstract PartialResponseWritergetPartialResponseWriter()Return theResponseWriterto which components should direct their output for partial view rendering.abstract java.util.Collection<java.lang.String>getRenderIds()Return aCollectionof client identifiers from the current request with the request parameter namePARTIAL_RENDER_PARAM_NAME.abstract booleanisAjaxRequest()Returntrueif the request headerFaces-Requestis present with the valuepartial/ajax.abstract booleanisExecuteAll()ReturntrueifisAjaxRequest()returnstrueandPARTIAL_EXECUTE_PARAM_NAMEis present in the current request with the valueALL_PARTIAL_PHASE_CLIENT_IDS.abstract booleanisPartialRequest()ReturntrueisAjaxRequest()returnstrueor if the request headerFaces-Requestis present with the valuepartial/process.abstract booleanisRenderAll()ReturntrueifisAjaxRequest()returnstrueandPARTIAL_RENDER_PARAM_NAMEis present in the current request with the valueALL_PARTIAL_PHASE_CLIENT_IDS.booleanisResetValues()Returntrueif the incoming request has a parameter named by the value ofRESET_VALUES_PARAM_NAMEand that value istrue.abstract voidprocessPartial(PhaseId phaseId)Perform lifecycle processing on components during the indicatedphaseId.abstract voidrelease()Release any resources associated with thisPartialViewContextinstance.abstract voidsetPartialRequest(boolean isPartialRequest)Dynamically indicate that this is a partial request.abstract voidsetRenderAll(boolean renderAll)Indicate the entire view must be rendered ifrenderAllistrue.
-
-
-
Field Detail
-
PARTIAL_RENDER_PARAM_NAME
public static final java.lang.String PARTIAL_RENDER_PARAM_NAME
The request parameter name whose request parameter value is a
Collectionof 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 java.lang.String PARTIAL_EXECUTE_PARAM_NAME
The request parameter name whose request parameter value is a
Collectionof 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
-
RESET_VALUES_PARAM_NAME
public static final java.lang.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 returntruefromisResetValues().- Since:
- 2.2
- See Also:
- Constant Field Values
-
ALL_PARTIAL_PHASE_CLIENT_IDS
public static final java.lang.String ALL_PARTIAL_PHASE_CLIENT_IDS
The value that when used with
PARTIAL_EXECUTE_PARAM_NAMEorPARTIAL_RENDER_PARAM_NAMEindicates these phases must be skipped.- Since:
- 2.0
- See Also:
- Constant Field Values
-
-
Method Detail
-
getExecuteIds
public abstract java.util.Collection<java.lang.String> getExecuteIds()
Return a
Collectionof client identifiers from the current request with the request parameter namePARTIAL_EXECUTE_PARAM_NAME. If there is no such request parameter, return an emptyCollection. These client identifiers are used to identify components that will be processed during theexecutephase of the request processing lifecycle. The returnedCollectionis mutable.- Throws:
java.lang.IllegalStateException- if this method is called after this instance has been released- Since:
- 2.0
-
getRenderIds
public abstract java.util.Collection<java.lang.String> getRenderIds()
Return a
Collectionof client identifiers from the current request with the request parameter namePARTIAL_RENDER_PARAM_NAME. If there is no such request parameter, return an emptyCollection. These client identifiers are used to identify components that will be processed during therenderphase of the request processing lifecycle. The returnedCollectionis mutable.- Throws:
java.lang.IllegalStateException- if this method is called after this instance has been released- Since:
- 2.0
-
getPartialResponseWriter
public abstract PartialResponseWriter getPartialResponseWriter()
Return the
ResponseWriterto 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:
java.lang.IllegalStateException- if this method is called after this instance has been released- Since:
- 2.0
-
isAjaxRequest
public abstract boolean isAjaxRequest()
Return
trueif the request headerFaces-Requestis present with the valuepartial/ajax. Otherwise, returnfalse.- Throws:
java.lang.IllegalStateException- if this method is called after this instance has been released- Since:
- 2.0
-
isPartialRequest
public abstract boolean isPartialRequest()
Return
trueisAjaxRequest()returnstrueor if the request headerFaces-Requestis present with the valuepartial/process. Otherwise, returnfalse.- Throws:
java.lang.IllegalStateException- if this method is called after this instance has been released- Since:
- 2.0
-
isExecuteAll
public abstract boolean isExecuteAll()
Return
Otherwise, returntrueifisAjaxRequest()returnstrueandPARTIAL_EXECUTE_PARAM_NAMEis present in the current request with the valueALL_PARTIAL_PHASE_CLIENT_IDS.false.- Throws:
java.lang.IllegalStateException- if this method is called after this instance has been released- Since:
- 2.0
-
isRenderAll
public abstract boolean isRenderAll()
Return
Otherwise, returntrueifisAjaxRequest()returnstrueandPARTIAL_RENDER_PARAM_NAMEis present in the current request with the valueALL_PARTIAL_PHASE_CLIENT_IDS.false.- Throws:
java.lang.IllegalStateException- if this method is called after this instance has been released- Since:
- 2.0
-
isResetValues
public boolean isResetValues()
Return
trueif the incoming request has a parameter named by the value ofRESET_VALUES_PARAM_NAMEand that value istrue. To preserve backward compatibility with custom implementations that may have extended from an earlier version of this class, an implementation is provided that returnsfalse. A compliant implementation must override this method to take the specified action.- Since:
- 2.2
-
setRenderAll
public abstract void setRenderAll(boolean renderAll)
Indicate the entire view must be rendered if
renderAllistrue.- Parameters:
renderAll- the valuetrueindicates the entire view must be rendered.- Throws:
java.lang.IllegalStateException- if this method is called after this instance has been released- Since:
- 2.0
-
setPartialRequest
public abstract void setPartialRequest(boolean isPartialRequest)
Dynamically indicate that this is a partial request.
- Parameters:
isPartialRequest- the valuetrueindicates this is a partial request.- Throws:
java.lang.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
PartialViewContextinstance.- Throws:
java.lang.IllegalStateException- if this method is called after this instance has been released
-
processPartial
public abstract void processPartial(PhaseId phaseId)
Perform lifecycle processing on components during the indicated
phaseId. Only those components with identifiers existing in theCollectionreturned fromgetExecuteIds()andgetRenderIds()will be processed.- Parameters:
phaseId- thePhaseIdthat indicates the lifecycle phase the components will be processed in.
-
-