public final class Ajax extends Object
PartialViewContext. There are also shortcuts to the current
OmniPartialViewContext instance.| Modifier and Type | Method and Description |
|---|---|
static void |
data(Map<String,Object> data)
Add the given mapping of data arguments to the current ajax response.
|
static void |
data(Object... namesValues)
Add the given data arguments to the current ajax response.
|
static void |
data(String name,
Object value)
Add the given data argument to the current ajax response.
|
static PartialViewContext |
getContext()
Returns the current partial view context (the ajax context).
|
static void |
oncomplete(String... scripts)
Execute the given scripts on complete of the current ajax response.
|
static void |
update(String... clientIds)
Update the given client IDs in the current ajax response.
|
public static PartialViewContext getContext()
Note that whenever you absolutely need this method to perform a general task, you might want to consider to submit a feature request to OmniFaces in order to add a new utility method which performs exactly this general task.
FacesContext.getPartialViewContext()public static void update(String... clientIds)
:.clientIds - The client IDs to be updated in the current ajax response.PartialViewContext.getRenderIds()public static void oncomplete(String... scripts)
scripts - The scripts to be executed.OmniPartialViewContext.addCallbackScript(String)public static void data(String name, Object value)
OmniFaces.Ajax.data.name - The argument name.value - The argument value.OmniPartialViewContext.addArgument(String, Object)public static void data(Object... namesValues)
String. They are as JSON
object available by OmniFaces.Ajax.data.namesValues - The argument names and values.IllegalArgumentException - When the arguments length is not even, or when a name is not a string.OmniPartialViewContext.addArgument(String, Object)public static void data(Map<String,Object> data)
OmniFaces.Ajax.data.data - The mapping of data arguments.OmniPartialViewContext.addArgument(String, Object)