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!

Block the default IG warning popup on unsaved changes

Daniel_A5 days ago — edited 5 days ago

Hello All,

I am working on a scenario where I have to skip/stop the IG popup warning on unsaved changes from firing. Appreciate any help.

Below is my specific problem I am trying to solve.

Setup:
In my page, I have 2 radio group items(displayed as pill buttons). Let's call them P10_RG_1 (values - 100,200,300) and P10_RG_2 (values - A,B,C). And an Interactive Grid (static_id = DATA_GRID).
I have a custom process for the IG since I am passing the values of items P10_RG_1 and P10_RG_2.

A OnChange dynamic action is in place, which will refresh the IG region for the selections made in P10_RG_1 or P10_RG_2 showing the respective data.
The user can add/edit rows for the radio group selections made. This process works fine.

Issue and Challenge:
Let's say the User selected P10_RG_1 = 100, P10_RG_2 = B and made 5 entries in the IG. Before clicking the Save, if he accidentally/intentionally clicks on P10_RG_1 (sets it to 200) , the default
IG warning popup appears (There are unsaved changes.Do you want to continue?). Clicking on 'Ok' will delete the 5 rows and set the P10_RG_1 value to 200. Clicking on 'Cancel' will retain the 5 rows but
it doesn't change the value of P10_RG_1 back to 100. Now, if the User clicks on Save again the rows which are intended to fall under bucket 100 gets inserted under 200.

To overcome this, I have used a custom code (attached) execute when page loads. This has resolved my issue partially.
From the above example, when the User clicks 'Cancel' it will not only retain the 5 rows but also switches back the P10_RG_1 selection to it's old value 100. And then by clicking on Save, the rows get inserted
into 100 bucket.
The same applies to the other radio group item P10_RG_2 as well.

The attached code using custom popup warning message (You have unsaved grid changes. Changing this option may discard them. Continue?) which is firing first and on top of it the default IG warning message pop is firing.
The User has to click 'Cancel' on two popups to get back to the page. Since my custom pop is working as expected, how do I skip/bypass the IG default warning popup?

I tried a few suggestions from the forums/blogs and ChatGPT but none of them worked. I am still seeing the two popups.

Versions 24.2.5; 19c

Any help is appreciated.

Thank you all in advance,
D

custom_code.txt

Comments
Post Details
Added 5 days ago
1 comment
78 views