public class PartialViewContextImpl extends PartialViewContext
ALL_PARTIAL_PHASE_CLIENT_IDS, PARTIAL_EVENT_PARAM_NAME, PARTIAL_EXECUTE_PARAM_NAME, PARTIAL_RENDER_PARAM_NAME, RESET_VALUES_PARAM_NAME
Constructor and Description |
---|
PartialViewContextImpl(FacesContext ctx) |
Modifier and Type | Method and Description |
---|---|
List<String> |
getEvalScripts()
Returns a mutable |
Collection<String> |
getExecuteIds()
Return a
|
PartialResponseWriter |
getPartialResponseWriter()
Return the |
Collection<String> |
getRenderIds()
Return a
|
boolean |
isAjaxRequest()
Return |
boolean |
isExecuteAll()
Return |
boolean |
isPartialRequest()
Return |
boolean |
isRenderAll()
Return |
boolean |
isResetValues()
Return |
void |
processPartial(PhaseId phaseId)
Perform lifecycle processing on components during the indicated
|
void |
release()
Release any
resources associated with this
PartialViewContext
instance. |
void |
setPartialRequest(boolean isPartialRequest)
Dynamically indicate that this is a partial request. |
void |
setRenderAll(boolean renderAll)
Indicate the entire view must be rendered if
|
public PartialViewContextImpl(FacesContext ctx)
public boolean isAjaxRequest()
PartialViewContext
Return true
if the request header
Faces-Request
is present with the value
partial/ajax
.
Otherwise, return false
.
isAjaxRequest
in class PartialViewContext
PartialViewContext.isAjaxRequest()
public boolean isPartialRequest()
PartialViewContext
Return true
PartialViewContext.isAjaxRequest()
returns
true
or if the request header
Faces-Request
is present with the value
partial/process
.
Otherwise, return false
.
isPartialRequest
in class PartialViewContext
PartialViewContext.isPartialRequest()
public boolean isExecuteAll()
PartialViewContext
Return true
if PartialViewContext.isAjaxRequest()
returns true
and PartialViewContext.PARTIAL_EXECUTE_PARAM_NAME
is present in the current request with the value
PartialViewContext.ALL_PARTIAL_PHASE_CLIENT_IDS
.
Otherwise, return false
.
isExecuteAll
in class PartialViewContext
PartialViewContext.isExecuteAll()
public boolean isRenderAll()
PartialViewContext
Return true
if PartialViewContext.isAjaxRequest()
returns true
and PartialViewContext.PARTIAL_RENDER_PARAM_NAME
is present in the current request with the value
PartialViewContext.ALL_PARTIAL_PHASE_CLIENT_IDS
.
Otherwise, return false
.
isRenderAll
in class PartialViewContext
PartialViewContext.isRenderAll()
public void setRenderAll(boolean renderAll)
PartialViewContext
Indicate the entire view must be rendered if
renderAll
is true
.
setRenderAll
in class PartialViewContext
renderAll
- the value true
indicates
the entire view must be rendered.PartialViewContext.setRenderAll(boolean)
public boolean isResetValues()
PartialViewContext
Return true
if
the incoming request has a parameter named by the value of PartialViewContext.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.
isResetValues
in class PartialViewContext
public void setPartialRequest(boolean isPartialRequest)
PartialViewContext
Dynamically indicate that this is a partial request.
setPartialRequest
in class PartialViewContext
isPartialRequest
- the value true
indicates
this is a partial request.public Collection<String> getExecuteIds()
PartialViewContext
Return a
Collection
of client identifiers from the current request
with the request parameter name PartialViewContext.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.
getExecuteIds
in class PartialViewContext
PartialViewContext.getExecuteIds()
public Collection<String> getRenderIds()
PartialViewContext
Return a
Collection
of client identifiers from the current request
with the request parameter name PartialViewContext.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.
getRenderIds
in class PartialViewContext
PartialViewContext.getRenderIds()
public List<String> getEvalScripts()
PartialViewContext
Returns a mutable List
of scripts to be evaluated in client side on complete of ajax request.
getEvalScripts
in class PartialViewContext
List
of scripts to be evaluated in client side on complete of ajax request.PartialViewContext.getEvalScripts()
public void processPartial(PhaseId phaseId)
PartialViewContext
Perform lifecycle processing on components during the indicated
phaseId
. Only those components with identifiers existing in the Collection
returned
from PartialViewContext.getExecuteIds()
and PartialViewContext.getRenderIds()
will be processed.
When the indicated phaseId
equals PhaseId.RENDER_RESPONSE
, then perform the following
tasks in sequence:
PartialViewContext.isResetValues()
returns true
, then call
UIViewRoot.resetValues(FacesContext, Collection)
, passing PartialViewContext.getRenderIds()
.PartialViewContext.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
.StateManager.getViewState(javax.faces.context.FacesContext)
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
UIComponent.getContainerClientId(FacesContext)
on the view from whence this state originated, and
<SEP>
is the currently configured UINamingContainer.getSeparatorChar(FacesContext)
.
PartialViewContext.isRenderAll()
returns false
, then write out each script of PartialViewContext.getEvalScripts()
as an eval
element.processPartial
in class PartialViewContext
phaseId
- the PhaseId
that indicates
the lifecycle phase the components will be processed in.PartialViewContext.processPartial(javax.faces.event.PhaseId)
public PartialResponseWriter getPartialResponseWriter()
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.
getPartialResponseWriter
in class PartialViewContext
ResponseWriter
for outputPartialViewContext.getPartialResponseWriter()
public void release()
PartialViewContext
Release any
resources associated with this PartialViewContext
instance.
release
in class PartialViewContext
PartialViewContext.release()
Comments to: faces-dev@eclipse.org.
Copyright © 2019 Eclipse Foundation. All rights reserved.
Use is subject to license terms.