The apex.actions namespace contains global functions related to the Oracle APEX 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".
Plug-ins that define actions should use apex.actions.createContext and add actions to the created context after calling apex.region.create.
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) findContextById(pContextId) → {actions}
Return the actions interface for a context given by the element id of the context or the apex.region that contains the context.
Parameters:
Name | Type | Description |
---|---|---|
pContextId |
string | Element id of the context element or the id of the APEX region that contains the context element as its widget element. If this parameter is "global" the global context is returned. |
Returns:
- Type
- actions
Example
var igActions = apex.actions.findContextById( "contactsIG" );
igActions === apex.region( "contactsIG" ).call( "getActions" ) // true;
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 );
}
}
(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" );
Returns the current key caps. See apex.actions.setKeyCaps.
Returns:
- Type
- Object
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] );
Different types of keyboards for different types of operating systems or different languages can have different symbols printed on the keys. The shortcuts must be defined according to actions.shortcutName. This static method lets you set keyboard layout specific names or symbols to display for key names.
Note: This affects how shortcuts are displayed not how they are defined.
Parameters:
Name | Type | Description |
---|---|---|
pKeyCaps |
Object | null | An object that maps the shortcutName key name such as "Ctrl" or "A" to the desired word or character. Pass in null to clear all the key cap mappings. |
Example
apex.actions.setKeyCaps( {
"/": "Minus",
"Quote": "{",
"Minus": "?"
} );
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" );