The apex.actions namespace contains global functions related to the Oracle Application Express actions facility. The methods and properties of the global actions context are also available in the apex.actions namespace but are documented with the actions interface.
- Since:
- 5.1
(static) createContext(pTypeName, pContext) → {actions}
Create a new actions interface object that is scoped to the given DOM element context. Any action buttons or other UI elements must be within the given pContext. Focus must be within pContext for keyboard shortcuts defined in this context to be recognized. A global context at document.body is created automatically and is accessed from apex.actions. The global context type name is "global".
Parameters:
Name | Type | Description |
---|---|---|
pTypeName |
string | Type name of the actions context. |
pContext |
Element | DOM element context that actions are scoped within. |
Returns:
- Type
- actions
Example
var log1 = apex.actions.createContext( "logger", $("#myLogger")[0] );
(static) findContext(pTypeNameopt, pContext) → {actions}
Return the actions interface for a given context. The pTypeName is optional but if given must match the type name used when the context was created. This is not often needed because the actions object returned from createContext should be saved by any widget/component that created the context.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
pTypeName |
string |
<optional> |
The type name of the actions context. |
pContext |
Element | DOM element context that actions are scoped within. |
Returns:
- Type
- actions
Examples
var log1 = apex.actions.findContext( "logger", $("#myLogger")[0] );
var log1 = apex.actions.findContext( $("#myLogger")[0] );
(static) getContextsForType(pTypeName) → {Array.<actions>}
Return an array of all the actions context instances for a given type.
Parameters:
Name | Type | Description |
---|---|---|
pTypeName |
string | The type name of the actions contexts to return. |
Returns:
- Type
- Array.<actions>
Example
var loggers = apex.actions.getContextsForType( "logger" );
Return an array of all the actions context type names.
Returns:
- Type
- Array.<string>
Example
var i, j, types, type, contexts;
types = apex.actions.getContextTypes();
for ( i = 0; i < types.length; i++ ) { // for each context type
type = types[i];
contexts = apex.actions.getContextsForType( type );
for ( j = 0; j < contexts.length; j++ ) { // for each context instance
console.log("Action context type: " + type + " [" + j + "]. Actions: " + contexts[j].list().length );
}
}
Remove an actions context that was created with apex.actions.createContext.
Parameters:
Name | Type | Description |
---|---|---|
pTypeName |
string | Type name of the actions context to remove. |
pContext |
Element | DOM element context that actions are scoped within. |
Example
apex.actions.removeContext( "logger", $("#myLogger")[0] );
Get or set the type of shortcut key support. The default is "sequence".
Note: The shortcut key support setting does not affect what shortcuts can be defined for actions but only how what the user types is recognized.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
pShortcutType |
string |
<optional> |
One of "off", "single", "sequence". If not specified the current value is returned. |
Returns:
- Type
- string | undefined
Examples
apex.actions.shortcutSupport();
apex.actions.shortcutSupport( "off" );
apex.actions.shortcutSupport( "single" );