|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.omnifaces.util.Ajax
public final class Ajax
Collection of utility methods for working with PartialViewContext
. There are also shortcuts to the current
OmniPartialViewContext
instance.
Method Summary | |
---|---|
static void |
data(java.util.Map<java.lang.String,java.lang.Object> data)
Add the given mapping of data arguments to the current ajax response. |
static void |
data(java.lang.Object... namesValues)
Add the given data arguments to the current ajax response. |
static void |
data(java.lang.String name,
java.lang.Object value)
Add the given data argument to the current ajax response. |
static javax.faces.context.PartialViewContext |
getContext()
Returns the current partial view context (the ajax context). |
static void |
oncomplete(java.lang.String... scripts)
Execute the given scripts on complete of the current ajax response. |
static void |
update(java.lang.String... clientIds)
Update the given client IDs in the current ajax response. |
static void |
updateColumn(javax.faces.component.UIData table,
int index)
Update the column of the given UIData component at the given zero-based column index. |
static void |
updateRow(javax.faces.component.UIData table,
int index)
Update the row of the given UIData component at the given zero-based row index. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static javax.faces.context.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(java.lang.String... clientIds)
:
.
clientIds
- The client IDs to be updated in the current ajax response.PartialViewContext.getRenderIds()
public static void updateRow(javax.faces.component.UIData table, int index)
UIData
component at the given zero-based row index. This will basically
update all direct children of all UIColumn
components at the given row index.
Note that the to-be-updated direct child of UIColumn
must be a fullworthy JSF UI component which renders
a concrete HTML element to the output, so that JS/ajax can update it. So if you have due to design restrictions
for example a <h:panelGroup rendered="...">
without an ID, then you should give it an ID.
This way it will render a <span id="...">
which is updateable by JS/ajax.
table
- The UIData
component.index
- The zero-based index of the row to be updated.public static void updateColumn(javax.faces.component.UIData table, int index)
UIData
component at the given zero-based column index. This will basically
update all direct children of the UIColumn
component at the given column index in all rows. The column
index is the physical column index and does not depend on whether one or more columns is rendered or not (i.e. it
is not necessarily the same column index as the enduser sees in the UI).
Note that the to-be-updated direct child of UIColumn
must be a fullworthy JSF UI component which renders
a concrete HTML element to the output, so that JS/ajax can update it. So if you have due to design restrictions
for example a <h:panelGroup rendered="...">
without an ID, then you should give it an ID.
This way it will render a <span id="...">
which is updateable by JS/ajax.
table
- The UIData
component.index
- The zero-based index of the column to be updated.public static void oncomplete(java.lang.String... scripts)
scripts
- The scripts to be executed.OmniPartialViewContext.addCallbackScript(String)
public static void data(java.lang.String name, java.lang.Object value)
OmniFaces.Ajax.data
.
name
- The argument name.value
- The argument value.OmniPartialViewContext.addArgument(String, Object)
public static void data(java.lang.Object... namesValues)
String
. They are as JSON
object available by OmniFaces.Ajax.data
.
namesValues
- The argument names and values.
java.lang.IllegalArgumentException
- When the arguments length is not even, or when a name is not a string.OmniPartialViewContext.addArgument(String, Object)
public static void data(java.util.Map<java.lang.String,java.lang.Object> data)
OmniFaces.Ajax.data
.
data
- The mapping of data arguments.OmniPartialViewContext.addArgument(String, Object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |