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!

Dialog close event escape tab

miclesDec 3 2018 — edited Dec 5 2018

Hello everyone, I have a problem capturing the "escape" event for a modal dialog page.

First, as read on the forum, I put my "close" in the dialog attributes like this:

close: function (event, ui) {sepaq.dialogCloseEvent (event, ui, {dialogPageId: '& APP_PAGE_ID.'});

My fonction:

sepaq.dialogCloseEvent = function (event, ui, dialogPageId) {  
     const escape = 'Escape'  
     const type = ($(event).attr('originalEvent')) ? event.originalEvent.type : '' 
    
     apex.debug.info('dialogCloseEvent %s', dialogPageId) 
     apex.debug.info($(event).attr('originalEvent'))  
    
     switch (type) {  
          case 'click': 
               apex.navigation.dialog.close(true, dialogPageId)  
               break  
          case 'keydown':  
               let keypress = $(event.originalEvent.originalEvent).attr('key')  
               if (keypress === escape) { 
                    apex.navigation.dialog.close(true, dialogPageId) 
               }  
               break  
          default:  
               break 
     } 
}
On my parent page I must always receive the event closedialog .... not cancel. 

To capture the closure of the dialog with the X icon, there is no problem. the event.originalEvent.type is "click"
But I am unable to catch the "escape" tab event that closes the dialog  ... my code does not work.

($ (event) .attr ('originalEvent')) is always undefined.

Can anyone help ?






Comments
Post Details
Added on Dec 3 2018
5 comments
874 views