Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Openin a Modal page from the Actions menu of an IG

drossoMar 5 2020 — edited Mar 5 2020

Hi,

following what I learned yesterday on how to add a menu item to the Actions menu, now I'm facing the problem of calling a dialog modal page when the user clicks on that menu item..

I've tried many ways to do it, but all fail with different errors.

The last thing I tried was creating a PL/SQL process on the page and call it from the action (as explained in https://stackoverflow.com/questions/45022407/open-modal-dialog-through-javascript-oracle-apex/52122692#52122692)

As such, I created a PL/SQL process like this one (named "GetUploadUrl"):

declare 

    v_result varchar2(4000);

begin

    v_result := apex_util.prepare_url(apex_application.g_x01);

    htp.prn(v_result);

end;

And then, I declared the action as follows:

config.initActions = function( actions ) {

       var url = "f?p=" + $v('pFlowId') + ":14:" + $v('pInstance') + "::NO:RP::";

        actions.add( {

          name: "Upload",

          label: "Upload",

          icon: "fa fa-upload fa-2x",

          action: function( event, focusElement ) {

                    apex.server.process(   

                        'GetUploadUrl',

                        {x01: url},

                        { success: function (pData) {          

                                              console.log(pData);

                                               // Call Modal Dialog Page

                                               apex.navigation.redirect(pData);

                                           },

                            dataType: "text"                    

                        }

                 );

          }

        } );

    };

When I click on the "Upload" menu item, I get error 404.

Is there a better/easier way to accomplish this ? What am I doing wrong ?

Thank you

Comments
Post Details
Added on Mar 5 2020
2 comments
575 views