Skip to content

APEX page actions menu

Jeffrey Kemp edited this page Aug 17, 2019 · 8 revisions

Create a dropdown menu on an APEX page

Adapted from:

Blog post:

  1. Create a List (Shared Components)

    • Set target to URL: javascript:apex.event.trigger(document,'menuAction','DOSOMETHING')
  2. Create a List region on the page

    • Position: Content Body
    • Template: Blank with Attributes
    • Static ID: actions
  3. Create a Button on the page

    • CSS Classes: js-menuButton
    • Icon: a-Icon icon-menu-drop-down
    • Custom Attributes: data-menu="actions_menu"
  4. Create a Dynamic Action on the page

    • Event: Custom
    • Custom Event: menuAction
    • Selection Type: JavaScript Expression
    • JavaScript Expression: document
    • True Action: Execute JavaScript Code apex.submit({,showWait:true});

Open a Modal page

  1. Create a hidden item, e.g. P1_MODAL_URL

    Note - a separate item will be needed for each target page.

  2. Add a Before Header process with PL/SQL

    (if the target page is page 2, and it needs the record ID passed to it)

    :P1_MODAL_URL := apex_page.get_url(p_page=>2, p_items=>'P2_RECORD_ID', p_values=>:P1_RECORD_ID);

    P1_MODAL_URL will be set to something like:

      ,{title:'Page Title',height:'auto',width:'720',maxWidth:'960',modal:true,dialog:null}
      ,'t-Dialog-page--standard '+'',this);
  3. Set the list action


  4. Modify the Dynamic Action menuAction

    switch( {
      case 'OPEN_MODAL':

Don't open Modal page if user has unsaved changes

  1. Modify the Dynamic Action menuAction

    switch( {
      case 'OPEN_MODAL':
        if ( {
          apex.message.alert("Please save your changes first.");
        } else {