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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Issue with Warn on Unsaved Changes

B_BrockJul 28 2021 — edited Jul 28 2021

I have a page that is not performing as desired when the user encounters the Warn on Unsaved Changes dialog. I'm seeking advice on how to remedy...
My page consists of:
a Date Picker with Dynamic Actions attached, which fire when the field is changed.
3 hidden fields, whose values are set by the dynamic actions attached to the date picker.
an interactive grid
Intended behavior is that the user will choose a date from the date picker. The Dynamic actions retrieve values from the database and store them in the hidden fields, then refresh the Interactive Grid, retrieving information relevant to the selected date. The user makes modifications to the IG, and saves. I have custom pl/sql code that utilizes the values in the 3 hidden fields when inserting and/or updating the records from the grid.
Here's the issue we discovered: If the user makes a change to the grid, then selects a new date prior to saving, they will get the Warn on unsaved dialog box. However, because of the dynamic actions attached to the date picker, the values associated to the newly chosen date are loaded into the hidden fields BEFORE the warning is displayed. If the user clicks the CANCEL button, the fields on the page are no longer accurate in relation to the data in the interactive grid (the date picker has the newly chosen date, and the three hidden fields have incorrect values).
Is there a way that I can either have the warning displayed prior to the dynamic actions firing, OR is there a way that I can detect that the user has clicked the cancel button, and restore the values to their previous values before the date was changed?
APEX 20.2 on OCI

Comments

Post Details

Added on Jul 28 2021
2 comments
893 views