public class OmniPartialViewContext
extends javax.faces.context.PartialViewContextWrapper
PartialResponseWriter.startEval()
.ViewExpiredException
occurs during an ajax request on a restricted
page. The end-user 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 web application, so end-users do not need to register this
partial view context explicitly themselves.
Constructor and Description |
---|
OmniPartialViewContext(javax.faces.context.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.
|
static OmniPartialViewContext |
getCurrentInstance(javax.faces.context.FacesContext context)
Returns the current instance of the OmniFaces partial view context from the given faces context.
|
javax.faces.context.PartialResponseWriter |
getPartialResponseWriter() |
javax.faces.context.PartialViewContext |
getWrapped() |
void |
resetPartialResponse()
Reset the partial response.
|
void |
setPartialRequest(boolean partialRequest) |
public OmniPartialViewContext(javax.faces.context.PartialViewContext wrapped)
wrapped
- The wrapped partial view context.public javax.faces.context.PartialResponseWriter getPartialResponseWriter()
getPartialResponseWriter
in class javax.faces.context.PartialViewContextWrapper
public void setPartialRequest(boolean partialRequest)
setPartialRequest
in class javax.faces.context.PartialViewContext
public javax.faces.context.PartialViewContext getWrapped()
getWrapped
in interface javax.faces.FacesWrapper<javax.faces.context.PartialViewContext>
getWrapped
in class javax.faces.context.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.public static OmniPartialViewContext getCurrentInstance(javax.faces.context.FacesContext context)
context
- The faces context to obtain the current instance of the OmniFaces partial view context from.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.Copyright © 2012–2014 OmniFaces. All rights reserved.