public class OmniPartialViewContext extends 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.
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.
|
static OmniPartialViewContext |
getCurrentInstance(FacesContext context)
Returns the current instance of the OmniFaces partial view context from the given faces 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.public static OmniPartialViewContext getCurrentInstance(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.