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!

Oracle APEX - How to deal with Unresponsive Page when executing in SQL Command ?

Jasper TanglibApr 19 2021

Hi,
In Oracle Apex 20.2, when I execute a simple Delete query, the page hangs and just gives off a pop up that says the page is unresponsive.
Code:
DELETE FROM wwv_flow_files where ID = 19575854524840376
Pop Up:
User:
Not only does this occur when I execute a simple delete query but I also have other codes that triggers this issue such as loops and inserts.
I have already tried to do the following:
Log off from the workspace and relogged in.
Close all browsers and relogged in.
Restarted laptop.
After doing all of the above, I am still encountering the same issue. I have encountered this before but simply relogging into the workspace usually solved it but this time it has become more persistent.

How can I fix this issue?

Any ideas or suggestions are appreciated.
-Jazz

This post has been answered by Jasper Tanglib on Apr 20 2021
Jump to Answer

Comments

John Snyders-Oracle

Hi Bruce,

The grid view of Interactive Grid disables text selection on purpose. There are technical reasons why the mousedown event, which starts the text selection, is handled the way it is to prevent the default in some cases. But there is a logical justification as well. Because IG grid view supports selection (meaning the current row or rows are in a selected state) it doesn't support text selection. This is consistent with a multi line select list (<select size=10>...). You will note that selecting one or more items in a select list and pressing Ctrl+C does not copy what you have selected also you can not select parts of the text in a select list. The idea in both cases is that the control is letting you work with the data at a higher level than just text.

But what you or your users are trying to do is not unreasonable and others have asked for the same thing. I think it has come up on the forums before. In the future I hope that IG grid will support copy in a meaningful way.

In the mean time you could go back to using IR if this is an important use case or you could take matters into your own hands and do something like the following:

Add an event handler for the copy event. This handler should be on the body or document. I used a DA

Event: Custom

Custom Event: copy

Selection Type: jQuery Selector

jQuery Selector: body

Then add one JavaScript true action with this code:

// this handler must be on the body or document to work in chrome

var text, i, selection, gridSel;

var event = this.browserEvent.originalEvent; // need the clipboard event

// we only care about copy from a grid cell ignore the rest

if ( !$(document.activeElement).hasClass("a-GV-cell") ) {

    return;

}

var view = apex.region("emp").widget().interactiveGrid("getCurrentView"); // change "emp" to you IG static id

if ( view.internalIdentifier === "grid") {

    text = "";

    selection = window.getSelection();

    gridSel = view.view$.grid("getSelection");

    for (i = 0; i < gridSel.length; i++) {

        selection.selectAllChildren(gridSel[i][0]);

        text += selection.toString();

        if (gridSel[i].length > 1) {

            selection.selectAllChildren(gridSel[i][1]);

            text += " \t" + selection.toString();

        }

        text += "\r\n";

    }

    selection.removeAllRanges();

    event.clipboardData.setData('text/plain', text);

    event.preventDefault();

}

The above will copy the current grid selection to the clipboard when the user types Ctrl+C while in a grid cell.

The selection and clipboard events and APIs are not final standards yet so there may be some cross browser issues. I have tested this on Firefox and Chrome in Windows.

There are many possibilities here. If you just want the text of the current cell then replace the loop over the grid selection with something like:

window.getSelection().selectAllChildren(document.activeElement);

Regards,

-John

1 - 1

Post Details

Added on Apr 19 2021
11 comments
1,897 views