-
Field Summary
Fields inherited from class jakarta.faces.context.PartialViewContext
ALL_PARTIAL_PHASE_CLIENT_IDS, PARTIAL_EVENT_PARAM_NAME, PARTIAL_EXECUTE_PARAM_NAME, PARTIAL_RENDER_PARAM_NAME, RESET_VALUES_PARAM_NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns a mutableList
of scripts to be evaluated in client side on complete of ajax request.Return aCollection
of client identifiers from the current request with the request parameter namePartialViewContext.PARTIAL_EXECUTE_PARAM_NAME
.Return theResponseWriter
to which components should direct their output for partial view rendering.Return aCollection
of client identifiers from the current request with the request parameter namePartialViewContext.PARTIAL_RENDER_PARAM_NAME
.boolean
Returntrue
if the request headerFaces-Request
is present with the valuepartial/ajax
.boolean
Returntrue
ifPartialViewContext.isAjaxRequest()
returnstrue
andPartialViewContext.PARTIAL_EXECUTE_PARAM_NAME
is present in the current request with the valuePartialViewContext.ALL_PARTIAL_PHASE_CLIENT_IDS
.boolean
Returntrue
PartialViewContext.isAjaxRequest()
returnstrue
or if the request headerFaces-Request
is present with the valuepartial/process
.boolean
Returntrue
ifPartialViewContext.isAjaxRequest()
returnstrue
andPartialViewContext.PARTIAL_RENDER_PARAM_NAME
is present in the current request with the valuePartialViewContext.ALL_PARTIAL_PHASE_CLIENT_IDS
.boolean
Returntrue
if the incoming request has a parameter named by the value ofPartialViewContext.RESET_VALUES_PARAM_NAME
and that value istrue
.void
processPartial
(PhaseId phaseId) Perform lifecycle processing on components during the indicatedphaseId
.void
release()
Release any resources associated with thisPartialViewContext
instance.void
setPartialRequest
(boolean isPartialRequest) Dynamically indicate that this is a partial request.void
setRenderAll
(boolean renderAll) Indicate the entire view must be rendered ifrenderAll
istrue
.
-
Constructor Details
-
PartialViewContextImpl
-
-
Method Details
-
isAjaxRequest
public boolean isAjaxRequest()Description copied from class:PartialViewContext
Return
true
if the request headerFaces-Request
is present with the valuepartial/ajax
. Otherwise, returnfalse
.- Specified by:
isAjaxRequest
in classPartialViewContext
- Returns:
- whether or not this is an ajax request
- See Also:
-
isPartialRequest
public boolean isPartialRequest()Description copied from class:PartialViewContext
Return
true
PartialViewContext.isAjaxRequest()
returnstrue
or if the request headerFaces-Request
is present with the valuepartial/process
. Otherwise, returnfalse
.- Specified by:
isPartialRequest
in classPartialViewContext
- Returns:
- whether or not this request is partial
- See Also:
-
isExecuteAll
public boolean isExecuteAll()Description copied from class:PartialViewContext
Return
true
ifPartialViewContext.isAjaxRequest()
returnstrue
andPartialViewContext.PARTIAL_EXECUTE_PARAM_NAME
is present in the current request with the valuePartialViewContext.ALL_PARTIAL_PHASE_CLIENT_IDS
. Otherwise, returnfalse
.- Specified by:
isExecuteAll
in classPartialViewContext
- Returns:
- whether or not this is an execute all request
- See Also:
-
isRenderAll
public boolean isRenderAll()Description copied from class:PartialViewContext
Return
true
ifPartialViewContext.isAjaxRequest()
returnstrue
andPartialViewContext.PARTIAL_RENDER_PARAM_NAME
is present in the current request with the valuePartialViewContext.ALL_PARTIAL_PHASE_CLIENT_IDS
. Otherwise, returnfalse
.- Specified by:
isRenderAll
in classPartialViewContext
- Returns:
- whether or not this is a render all request
- See Also:
-
setRenderAll
public void setRenderAll(boolean renderAll) Description copied from class:PartialViewContext
Indicate the entire view must be rendered if
renderAll
istrue
.- Specified by:
setRenderAll
in classPartialViewContext
- Parameters:
renderAll
- the valuetrue
indicates the entire view must be rendered.- See Also:
-
isResetValues
public boolean isResetValues()Description copied from class:PartialViewContext
Return
true
if the incoming request has a parameter named by the value ofPartialViewContext.RESET_VALUES_PARAM_NAME
and 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.- Overrides:
isResetValues
in classPartialViewContext
- Returns:
- whether or not this is a reset values request
-
setPartialRequest
public void setPartialRequest(boolean isPartialRequest) Description copied from class:PartialViewContext
Dynamically indicate that this is a partial request.
- Specified by:
setPartialRequest
in classPartialViewContext
- Parameters:
isPartialRequest
- the valuetrue
indicates this is a partial request.
-
getExecuteIds
Description copied from class:PartialViewContext
Return a
Collection
of client identifiers from the current request with the request parameter namePartialViewContext.PARTIAL_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 theexecute
phase of the request processing lifecycle. The returnedCollection
is mutable.- Specified by:
getExecuteIds
in classPartialViewContext
- Returns:
- the ids for the execute portion of the lifecycle
- See Also:
-
getRenderIds
Description copied from class:PartialViewContext
Return a
Collection
of client identifiers from the current request with the request parameter namePartialViewContext.PARTIAL_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 therender
phase of the request processing lifecycle. The returnedCollection
is mutable.- Specified by:
getRenderIds
in classPartialViewContext
- Returns:
- the ids for the render portion of the lifecycle
- See Also:
-
getEvalScripts
Description copied from class:PartialViewContext
Returns a mutable
List
of scripts to be evaluated in client side on complete of ajax request.- Specified by:
getEvalScripts
in classPartialViewContext
- Returns:
- A mutable
List
of scripts to be evaluated in client side on complete of ajax request. - See Also:
-
processPartial
Description copied from class:PartialViewContext
Perform lifecycle processing on components during the indicated
phaseId
. Only those components with identifiers existing in theCollection
returned fromPartialViewContext.getExecuteIds()
andPartialViewContext.getRenderIds()
will be processed.When the indicated
phaseId
equalsPhaseId.RENDER_RESPONSE
, then perform the following tasks in sequence:- If
PartialViewContext.isResetValues()
returnstrue
, then callUIViewRoot.resetValues(FacesContext, Collection)
, passingPartialViewContext.getRenderIds()
. - If
PartialViewContext.isRenderAll()
returnsfalse
, then render any component resource ofUIViewRoot
whoseResourceHandler.getRendererTypeForResourceName(String)
does not returnnull
, and whoseUIComponent.getChildCount()
is zero, and whoseResourceHandler.isResourceRendered(FacesContext, String, String)
returnsfalse
, in anupdate
element with an identifier ofjakarta.faces.Resource
. - Process the components.
- Obtain the state by calling
StateManager.getViewState(jakarta.faces.context.FacesContext)
and write it out as anupdate
element with an identifier of<VIEW_ROOT_CONTAINER_CLIENT_ID><SEP>jakarta.faces.ViewState
where<VIEW_ROOT_CONTAINER_CLIENT_ID>
is the return fromUIComponent.getContainerClientId(FacesContext)
on the view from whence this state originated, and<SEP>
is the currently configuredUINamingContainer.getSeparatorChar(FacesContext)
. - If
PartialViewContext.isRenderAll()
returnsfalse
, then write out each script ofPartialViewContext.getEvalScripts()
as aneval
element.
- Specified by:
processPartial
in classPartialViewContext
- Parameters:
phaseId
- thePhaseId
that indicates the lifecycle phase the components will be processed in.- See Also:
- If
-
getPartialResponseWriter
Description copied from class:PartialViewContext
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.- Specified by:
getPartialResponseWriter
in classPartialViewContext
- Returns:
- the
ResponseWriter
for output - See Also:
-
release
public void release()Description copied from class:PartialViewContext
Release any resources associated with this
PartialViewContext
instance.- Specified by:
release
in classPartialViewContext
- See Also:
-