Skip to main content

Usage

Basic usage

  1. Create APEX List POPUP_MENU
  2. Create entries and define according to your needs (authorization scheme, action, etc)
  3. Create new button BTN_POPUP_MENU
  4. Create dynamic action
    1. Set Event to Click
    2. Set Selection Type to Button
    3. Set Button to BTN_POPUP_MENU
    4. Set Advanced \ Event Scope to Dynamic
    5. Set Advanced \ Static Container (jQuery Selector) to body
  5. Create True action
    1. Set Action to United Codes Context Menu [Plug-In]
    2. Set List name to POPUP_MENU
  6. Save & run a page

Clicking the button BTN_POPUP_MENU will create a popup menu.

Contextual menu

The plug-in can be implemented to alter the default context menu (right mouse button click).

  1. Create APEX List POPUP_MENU
  2. Create entries and define according to your needs (authorization scheme, action, etc)
  3. Create dynamic action
    1. Set Event to Custom
    2. Set Custom Event to contextmenu
    3. Set Selection Type to JavaScript Expression
    4. Set JavaScript Expression to document
    5. Set Advanced \ Event Scope to Dynamic
    6. Set Advanced \ Static Container (jQuery Selector) to body
  4. Create True action
    1. Set Action to United Codes Context Menu [Plug-In]
    2. Set List name to POPUP_MENU
    3. [Optional] Set Affected Elements to narrow the area in which context menu will be available. For example region.
  5. Save & run a page

The contextual menu can be applied to any element by specifying Selection Type = jQuery Selector.

The contextual menu can be positioned differently:

  • when Selection Type = JavaScript Expression and JavaScript Expression = document then menu is positioned to right-click event position properties event.pageX and event.pageY
    • when Affected Elements is defined then the menu is available only for the area defined by the given Affected Elements
  • When Selection Type = jQuery Selector then the menu is positioned to given jQuery Selector

Advanced usage

Please read inline help text for attribute Override Behaviour for detailed information about JSON object extending existing list entry.

  1. Create APEX List POPUP_MENU_EXTEND

  2. Create entry

    1. Set List Entry Label to Extended behavior
    2. Set Target type to URL
    3. Set URL Target to javascript: void(0);
    4. Set User-defined Attribute 1 to EXTENDED_BEHAVIOUR
  3. Create new button BTN_POPUP_MENU_EXTEND

  4. Create dynamic action

    1. Set Event to Click
    2. Set Selection Type to Button
    3. Set Button to BTN_POPUP_MENU_EXTEND
  5. Create True action

    1. Set Action to United Codes Context Menu [Plug-In]
    2. Set List name to POPUP_MENU_EXTEND
    3. In Settings check Override Behaviour
    4. Set Override behavior to [1]
  6. Save & run a page

Alter entry behavior

[1] JavaScript code for point 5.d

return {
"EXTENDED_BEHAVIOUR": {
"action": function( pMenuOptions, pTriggeringElement ){
//Code to be executed when users clicks on entry
alert('Altered action');
return void(0);
},
"disabled": function( pMenuOptions, pEntry ) {
return false;
},
"hide": function(pMenuOptions){
return false;
}
}
};

Add submenu

[1] JavaScript code for point 5.iv

return {
"EXTENDED_BEHAVIOUR": {
"items": [
{
"type": "action",
"labelKey": "Action 1",
"action": function( pMenuOptions, pTriggeringElement ){
alert("Action 1");
}
},
{
"type": "action",
"labelKey": "Action 2",
"action": function( pMenuOptions, pTriggeringElement ){
alert("Action 2");
}
},
{
"type": "action",
"labelKey": "Action 3",
"action": function( pMenuOptions, pTriggeringElement ){
alert("Action 3");
}
}
]
}
};