5
votes

I am trying to close a modal dialog page after changes have been made and then refresh the edit form that was underneath the modal dialog in Oracle Apex.

I tried using dynamic action to close the dialog, but it seems that the dynamic action proceeds the processing step, resulting in the data not being saved into the database after the modal dialog has closed.

modal dialog = page edit form = page

modal dialog is a pop out on the edit form

Is there a way to close the dialog, while saving the data and also refresh the edit form?

I think there is a way to also redirect to previous page but I do not know how to do that.

2
What did you set the dialog close dynamic action on? You should set it on either the button or region that triggers the opening of the modal window (on the parent page)RLOG
@RLOG but how do I close the dialog without interfering with the processing action?charlie tsai
Perhaps you are not applying/committing the changes to database prior to closing your dialog page. On the modal dialog page where the region containing the data is based on a source table, Add a button with behavior action = "Submit Page" and Database Action = "SQL Update action". That will essentially perform the update of data and commit it to the database. Then when your modal dialog closes, the data is already updated. Then when control is returned to the Calling page you will need it's Dynamic Action - Dialog Close set to "Refresh".B_e_n_n_y_

2 Answers

5
votes

Yes there are many ways to close the dialog box while saving the data.

  1. you can use the process for dialog close, process should be after your process which is saving data.

  2. Javascript: please refer below link

http://ashishtheapexian.blogspot.in/2017/06/refresh-region-of-base-page-when.html

https://apex.oracle.com/pls/apex/f?p=1200008:15:132444785184935::NO:RP:P15_POST_ID:142

  1. Branching : You can create a branch after processing point. this will redirect and close the dialog after saving you data to the database.
2
votes

Refresh Page when Dialog is closed. Click here

this blog will give enough information about how to refresh the Page when model dialog closed (cross icon).

We can trigger a dynamic action when user press cross icon in model dialog. This will archive by pasting the following code in Model dialog property-> Dialog -> attribute:

close: function(event, ui) {apex.navigation.dialog.close(true,{dialogPageId:7});}

And one more thing we need to keep in mind that "chained property" set to Yes for page to refresh. Here 7 is model dialog page number. Above given code will trigger dialog closed event.