public class OmniPartialViewContext extends PartialViewContextWrapper
PartialResponseWriter.startEval()
.ExternalContext.getResponseBufferSize()
regardless of
ResponseWriter.flush()
calls (which defaults to javax.faces.FACELETS_BUFFER_SIZE
).ViewExpiredException
occurs during an ajax request on a restricted
page. The enduser will now properly be redirected to the login page.Ajax
utility class to easily add callback scripts and arguments.
This partial view context is already registered by OmniFaces' own faces-config.xml and thus gets auto-initialized when the OmniFaces JAR is bundled in a webapp, so end-users do not need to register this partial view context explicitly themselves.
ALL_PARTIAL_PHASE_CLIENT_IDS, PARTIAL_EXECUTE_PARAM_NAME, PARTIAL_RENDER_PARAM_NAME
Constructor and Description |
---|
OmniPartialViewContext(PartialViewContext wrapped)
Construct a new OmniFaces partial view context around the given wrapped partial view context.
|
Modifier and Type | Method and Description |
---|---|
void |
addArgument(String name,
Object value)
Add an argument to the partial response.
|
void |
addCallbackScript(String callbackScript)
Add a callback script to the partial response.
|
void |
closePartialResponse()
Close the partial response.
|
static OmniPartialViewContext |
getCurrentInstance()
Returns the current instance of the OmniFaces partial view context.
|
PartialResponseWriter |
getPartialResponseWriter() |
PartialViewContext |
getWrapped() |
void |
resetPartialResponse()
Reset the partial response.
|
void |
setPartialRequest(boolean isPartialRequest) |
getExecuteIds, getRenderIds, isAjaxRequest, isExecuteAll, isPartialRequest, isRenderAll, processPartial, release, setRenderAll
public OmniPartialViewContext(PartialViewContext wrapped)
wrapped
- The wrapped partial view context.public PartialResponseWriter getPartialResponseWriter()
getPartialResponseWriter
in class PartialViewContextWrapper
public void setPartialRequest(boolean isPartialRequest)
setPartialRequest
in class PartialViewContext
public PartialViewContext getWrapped()
getWrapped
in interface FacesWrapper<PartialViewContext>
getWrapped
in class PartialViewContextWrapper
public void addArgument(String name, Object value)
OmniFaces.Ajax.data
.
For supported argument value types, read Json.encode(Object)
. If a given argument type is not supported,
then an IllegalArgumentException
will be thrown during end of render response.name
- The argument name.value
- The argument value.public void addCallbackScript(String callbackScript)
callbackScript
- The callback script to be added to the partial response.public void resetPartialResponse()
PartialResponseWriter
.FullAjaxExceptionHandler
public void closePartialResponse()
FullAjaxExceptionHandler
public static OmniPartialViewContext getCurrentInstance()
IllegalStateException
- When there is no current instance of the OmniFaces partial view context. That can
happen when the OmniPartialViewContextFactory
is not properly registered, or when there's another
PartialViewContext
implementation which doesn't properly delegate through the wrapped instance.